Mac Carbon |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Mar 08, 2007 12:36 pm Post subject: Fighting Xcode |
|
|
iDevGames: XCode Build Question
"The problem is that if I only change my resources, I have to do a clean,
then a build to get the new resources deployed. The project consists of 50
or so source code files, and a build takes more than 30 seconds." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Wed Apr 11, 2007 6:47 pm Post subject: |
|
|
Red Sweater: Xcode Index
"f you use Xcode often, surely you appreciate the “Code Sense Index.” This
is the magic cache of symbolic info that allows tricks like command-double-
clicking a variable name to jump to its declaration, or Opt-Period to complete
a function name. ... Unless. Ughh!!!!! Angst, angst, angst! It’s got crap in the
index." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Apr 13, 2007 12:37 am Post subject: |
|
|
idevapps.com - My apps don't run anymore!
"Turns out I was using ZeroLink... But I found out that it only happens when
I set it to be the default application to open all .rtf files. If I change only one
file to open with it, it runs perfectly." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Apr 21, 2007 9:42 pm Post subject: |
|
|
I downloaded some demo projects from Apple's site and Xcode complained
it can't find MacOSX10.4u.sdk. I didn't even knew something like that exists
in carbon projects.
I'm not sure exactly what I did to make this error go away - I just followed
what this document told me to do: Building Your Code.
Now, everything is fine again. ;)
First, it was: HISimpleList. It has that MacOSX10.4u.sdk problem, but then
I found another list example: SimpleList. It has issue with stdlibc++.a. Well,
just removing that library from the project solves it. |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Fri Jun 15, 2007 3:59 pm Post subject: |
|
|
Carbon List: Is Carbon Viable?
"What I *do* need is better ways to navigate my code. Xcode's Find in Project
feature is an interface and usability disaster, and its Jump to Definition feature
is almost useless to me. These are important pieces of functionality on which
I rely heavily and their implementation in Xcode severely impacts my productivity
and enjoyment level when I'm using Xcode." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Aug 22, 2007 5:55 pm Post subject: |
|
|
adc: Mac OS X Xcode 2.4 Release Notes: Compiler Tools
These notes are for the Mac OS X Xcode 2.4 Release of the compiler tools.
They contain information about the following topics:
The Mac OS X Mach-O GNU-based assemblers
The Mac OS X 32-bit Mach-O static link editor
Mach-O object file tools (nm, otool, and so on) |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Aug 22, 2007 6:13 pm Post subject: |
|
|
roobaLog: Just Because it Compiles, Doesn’t Mean it Works
"My question is why doesn’t the compiler whine about me sending 3 arguments
to a C function that only takes 1? I don’t even see a warning. I dug a little
deeper. Turns if you want to see the error, you have to #include<unistd.h>
(that’s where usleep’s prototype is declared). So why does this even compile?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Aug 23, 2007 6:43 pm Post subject: |
|
|
CocoaDev - XCodeTips
"Enabling Warnings If you'd like to enable as many of gcc's compiler warnings
as possible, there are a few pitfalls to be aware of when doing so with Xcode.
The following is my advice based on my experience." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Aug 23, 2007 6:51 pm Post subject: |
|
|
MachTen - My top reasons why Mac developement with XCode is a nightmare...
"We've been working with XCode on the Mac for at least six month now.
We used to build all our Mac products with CodeWarrior 8.3 and 9 but decided
to drop it because it wasn't offering any support for the new Apple SDKs ...
... XCode uses the well known GCC compiler and all the suite of the GNU
toolchain which would supposedly offer a much better development environment.
I've been quite disapointed with that choice. Here are the main problems we
encountered with XCode" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Sun Aug 26, 2007 4:39 pm Post subject: |
|
|
Uli's blog - The Dangers of ZeroLink
"So, instead of just breaking or just working, ZeroLink can make unlinked
functions half-work. That's a thing to keep in mind... " |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Aug 27, 2007 11:52 pm Post subject: |
|
|
I hate this GCC warning: "suggest parentheses around assignment used as
truth value". I know the story behind it but I don't care. Tutorials like to give
very simplified examples, but I don't buy it.
So, putting "-Wall -Wno-parentheses -Wno-unused-variable" as "Other C flags"
did the trick. Now, instead of a few thousand warnings in my project - I have
none. That allows me to turn on treatment of warnings as errors.
P.S. Options to Request or Suppress Warnings |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Oct 17, 2007 10:35 pm Post subject: |
|
|
Apple List: Showing all the build settings
"If by "build settings" you actually mean "preprocessor macros," then you're
looking for -dM.
1) Project > Edit Current Target
2) In Build tab, find Other C Flags and add -dM to it
3) Choose your source file and select Build > Preprocess
You'll get a list of all the preprocessor macros defined for the compilation of
that file." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Nov 14, 2007 12:59 am Post subject: |
|
|
TheList: Change Application Name
Chris Espinosa: "The most common problem is that you have to change the
CFBundleExecutable in the Info.plist to match the new execitable name once
you change the product name. In recent versions of Xcode we set this to be
${EXECUTABLE_NAME} so it's propagated automatically, but in projects cre-
ated with templates from earlier versions, it's set at project creation time and
must be changed manually when the product name is changed." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Mar 02, 2008 7:35 pm Post subject: |
|
|
Because of some 3rd party code I had to change my C flags:
"-Wall -Wno-parentheses -Wno-unused-variable -Wno-unused-function -Wno-unused-label -Wno-trigraphs"
* see: GCC - Options to Request or Suppress Warnings
* see: warning: trigraph ... ignored - again
"The documentation is out of date. -Wtrigraphs has been included in
-Wall for a long time, but no one noticed because it didn't do
anything when trigraphs were disabled. We felt that they were a
common enough portability problem that they should be warned about
even when they were disabled..." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Thu Jun 05, 2008 3:15 pm Post subject: |
|
|
the List: Re: -Wall
"Finally, some versions of Xcode have a bug where you can't turn ZeroLink
off; that means you'll get what looks like a clean compile, but you'll crash as
soon as you try to run. The only way to fix this is to hand edit the project
file to turn off ZeroLink.
1) Find your project file. It ends in '.xcodeproj'. This is a bundle, so you can
either use the terminal and cd into it, or you can control click on it to open it
up (control click -> 'Show Package Contents').
2) ..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Apr 13, 2009 2:54 am Post subject: |
|
|
I hate drag&drop in editors!
Code: | defaults write com.apple.xcode NSDragAndDropTextDelay 0 |
And that anoying message:
Code: | write com.apple.xcode XCShowUndoPastSaveWarning NO |
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Jun 18, 2009 10:01 pm Post subject: |
|
|
MF - Xcode cannot find header file?
"I also edit the settings of "Header Search Path" to be /opt/local/include
and type
# include <gsl/gsl_xxx.h>
in my program.
But Xcode2 still cannot locate the file."
Heh: YES!
Just had this issue myself. I had #include <libxml/xmlmemory.h> and Xcode
was not able to locate it. Changing it to <libxml2/libxml/xmlmemory.h> didn't
solve anything. So I had to put libxml2 folder into project settings. At first I
typed "usr/include/libxml2/" into Header Search Paths option, but it didn't
work that way! Correct path is "/usr/include/libxml2/". |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Tue Mar 15, 2011 10:47 pm Post subject: |
|
|
MF - A Warning for those of you installing XCode 3 and 4
"If you're going to do this and have XCode 3 installed at the default /Developer,
you'll need to do 3 installs for things to work properly - namely, upgrade
XCode 3 to 4, then install XCode 3 elsewhere, then reinstall XCode 4. If you
do NOT do this, XCode 4 will crash immediately on launch with a plug-in error." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Jun 17, 2011 8:21 pm Post subject: |
|
|
Usefull flags, when needed:
-Wall
-Wno-parentheses
-Wno-unused-variable
-Wno-unused-function
-Wno-unused-label
-Wno-trigraphs
-Wno-idiomatic-parentheses // if (self = [self init]) |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Jun 25, 2011 12:02 pm Post subject: |
|
|
High Order Blog: Customizing Xcode File Templates
"One of the first things many users of Xcode want to do is customize the file
templates used to generate stubs for classes and other items in your project.
We’re spending most of our time building iPhone applications, so we’re inte-
rested in customizing the Cocoa Touch templates." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Jan 20, 2012 12:39 am Post subject: |
|
|
lists.apple.com - Re: recompile without -mlong-branch?
"The Snow Leopard version of the 10.4u SDK seems to contain an outdated
version of crt1.o. You can fix the linker warning on your own by recompiling
the Csu package from the Tiger sources;
Replace /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o with the newly
created version." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Aug 26, 2016 8:30 am Post subject: |
|
|
universalmind - What every iOS Developer Should Be Doing with Instruments
"You've just wrapped up development on a shiny new iOS project and
have done your best to ensure that the app doesn't crash and it seems to
run ok on your test devices, but is it ready to submit? If you haven't done
any profiling in Instruments, the answer is probably no. Just because it
doesn't crash doesn't mean that it's going to behave and run well on your
user's devices" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Dec 27, 2016 2:25 pm Post subject: |
|
|
so - Using Xcode post-build scripts to create a ZIP archive
"I am working on a super simple little app that I distribute as a ZIP archive.
The archive contains the app itself, a readme, and a few scripts. I wanted to
automate this process, so I added the scripts to my project and auto-copied
them into the build folder with a copy files build phase." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Dec 29, 2016 7:22 pm Post subject: |
|
|
lists.apple.com - Re: Not finding libraries
"I've sometimes seen a problem where Xcode thinks a '.a' file is a dynamic
library, which causes the linker to ignore it. You can fix that by changing the
file's type to 'Mach-O Object Code' in the file inspector in the right-hand pane." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Jan 10, 2017 5:07 pm Post subject: |
|
|
wikihow.com - How to Make a DMG File on a Mac
"One way to store or group files on a Mac is to create a Disk Image. A Disk
Image is a file which has the properties of a separate hard drive or CD and
allows for greater password protection and compression. It has a size limit
and options for encryption to keep your files safe and secure. While there
are a few applications that perform this task for you, it is recommended
that you complete this process manually."
Apple - Disk Utility for Mac: Create a disk image using Disk Utility |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Fri Jan 27, 2017 6:50 pm Post subject: |
|
|
adf - Porting old Cocoa projects to Xcode 7.3
"I have a number of very old Cocoa projects, created before Xcode using
Project Builder and Interface Builder. I tried opening these projects in Xcode
7.3 and they wouldn't build -- the projects were too old. Is there another
way to bring them up to date? Can the Interface Builder NIB file be updated
to work in a recent version of Xcode?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Apr 26, 2017 4:32 pm Post subject: |
|
|
eclecticlight - If you're still running El Capitan, Apple doesn't care about you
"Whereas older versions of Xcode shipped with a choice of target versions
of OS X, this Xcode offered just one. Well, two if you believed its non-choice
between macOS 10.12 and Latest macOS (macOS 10.12)." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Wed May 17, 2017 9:08 am Post subject: |
|
|
adc - Exporting Your Framework Interface
"For ANSI C-based code, you can usually just prefix an underscore character
to the name of a function or variable to get the symbol name. For languages
like C++, which uses mangled symbol names, you may need to run the nm
tool to get the list of existing symbol names. Run nm with the -g option to
see the currently exported symbols. You can then copy the output from the
tool and paste it into your exports file, ..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jul 31, 2017 6:01 pm Post subject: |
|
|
r - What programs/software do you use aside from Xcode?
"PaintCode is essential for me when doing UI. It is 99$ but isn't hard to find
for free online. Buy it if you can though it is really a great program and always
good to help out the devs." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Aug 03, 2017 3:44 pm Post subject: |
|
|
bitbar How to archive and export ipa from script using Xcode 6
"First, create yourself a build script. The proposed build script could start by a
clean and followed with performing an archive call:"
Code: | xcodebuild clean -project <PROJECT_NAME>.xcodeproj -configuration Release -alltargets
xcodebuild archive -project <PROJECT_NAME>.xcodeproj -scheme <NAME_OF_SCHEME> -archivePath <PROJECT_NAME>.xcarchive |
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Nov 20, 2017 11:17 pm Post subject: |
|
|
so - Move to beginning of text in Xcode
"As of 7.3 (not sure when it was added), Xcode seems to have turned this
on by default. Cmd-left in the Key Bindings preference pane is now bound
to Move to Beginning of Text.
Personally, this drives me bonkers, so I've changed it back to Move to
Beginning of Line." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Jan 24, 2018 10:31 pm Post subject: |
|
|
-Wno-idiomatic-parentheses // if (self = [self init]) |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Wed Feb 27, 2019 11:36 am Post subject: |
|
|
For some reason this script DOES work on Mojave/Xcode 10.1
cp ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME} ${PROJECT_DIR}/${EXECUTABLE_NAME}App
For some reason this script DOES NOT work on Mojave/Xcode 10.1
cp ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME} ${PROJECT_DIR}/${EXECUTABLE_NAME}App
Two computers, same project, build phase - run script. Works on one, does not on the other.
BUT THIS!!!!!
cp "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME}" "${PROJECT_DIR}/${EXECUTABLE_NAME}App" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Apr 10, 2019 4:48 pm Post subject: |
|
|
so - Suppressing deprecated warnings in Xcode
"With all the SDKs floating around, it's handy to be able to build for multiple
SDKs and platforms."
Code: | #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void) methodUsingDeprecatedStuff
{
//use deprecated stuff
}
#pragma GCC diagnostic pop |
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Mon Sep 11, 2023 12:58 pm Post subject: |
|
|
So, -Wno-unused-but-set-variable did not exist before but if I syncronize
projects with the Github, Xcode will have unrecognized flag warning so
-Wno-unknown-warning-option seems to do the trick
-Wall
-Wno-unused-variable
-Wno-parentheses
-Wno-unused-but-set-variable
-Wno-unknown-warning-option |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Mon Sep 11, 2023 10:39 pm Post subject: |
|
|
so - iOS scheme goes missing when I branch my project (Xcode 4.2)
"From my master branch, I exported the schemes I needed - I did by
navigating to Product > Scheme > Manage Schemes... on the Xcode menu.
I then selected the schemes I wanted to export (i.e. Development and
Release in my case). Finally, I chose the Export... option after clicking on
the gear icon as shown in the picture below." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Wed Nov 08, 2023 10:44 pm Post subject: |
|
|
r - FYI - Xcode 15 + iOS 17 Forces network debugging.
"Come to find out on iOS 17 + Xcode 15 Apple is now FORCING developers to
debug over the network. Now installs via Xcode take on average 250% more
time. There is no way to turn this off." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Mon Feb 05, 2024 7:07 pm Post subject: |
|
|
so - Can a breakpoint display the contents of "const unsigned char* variable"?
"...copy the type summary lldb has built in for char * for unsigned char *.
type summary list lists all of the built in type summaries; copying lldb-
179.5's summaries for char *:"
Last edited by Ike on Mon Feb 05, 2024 7:10 pm; edited 1 time in total |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3100 Location: Europe
|
Posted: Wed Mar 27, 2024 8:11 pm Post subject: |
|
|
r - WORKAROUND: Slow debugging with Xcode 15 + iOS 17
1. Disconnect iPhone from USB cable if already connected
2. Put iPhone in airplane mode
3. Connect to USB cable and wait for Xcode to finish connecting to it
4. Take iPhone out of airplane mode |
|
Back to top |
|
|
|