Re: Advice request on Xcode configuration for long term project.
Re: Advice request on Xcode configuration for long term project.
- Subject: Re: Advice request on Xcode configuration for long term project.
- From: "Paul Sanders" <email@hidden>
- Date: Thu, 3 Dec 2009 18:09:08 -0000
> I am really clueless on how I would set this up to create a
> nice *.app for
> me though
Actually, that's quite easy. There's nothing magic about a .app
bundle, you just need to create the correct file and folder
structure, which you can do with mkdir and cp once you know how.
It's something like:
MyApp.app/
Contents/
Info.plist
MacOS/
MyExecutable
MyDyLib1.dylib
MyDyLib2.dylib
...
Resources/
<nib files, strings and png's, typically>
For more details, see here:
http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
You could learn a lot by creating a simple Cocoa 'Hello world'
app in Xcode and seeing how it is put together. You can then
mimic what you see from the command line. Personally, I use a
hybrid approach. I work (and build) in Xcode because I find it
a very productive environment. The learning curve is not at all
steep, it beats the hell out of remembering and managing a bunch
of command line switches, and code sense and syntax-colourising
are a big win. But I use pre- and post-build scripts to copy
things like dylibs and resources around. This is probably
heresy, but it works for me.
If you are using dylibs, you will also want to get your head
around how your executable finds them at runtime. The key thing
to understand is that when a dylib is built, it contains the
name of the directory from which it will ultimately be loaded.
Then, when your executable links against said dylib, it stashes
that location away inside itself somewhere and will expect the
dylib to be where it promised it would be at runtime. You can
use the magic string @executable_path/name_of_my_dylib.dylib to
load the dylib from the same folder as the executable. This is
what I do. Some notes about that here:
http://www.cocoadev.com/index.pl?ApplicationLinking
There's also another, more flexible option, @rpath, but if your
dylibs are somewhere in your application bundle you shouldn't
need it. Google 'dyld rpath' for more information. I suggest
you place your dylibs in the Resources folder, rather than the
MacOS folder, if you plan to sign your code. Then they get
signed too, see 'man codesign' for details. You can get at them
like this:
@executable_path/../Resources/name_of_my_dylib.dylib
HTH - as you can see, I have purchased the T-shirt on this one -
Paul Sanders.
----
Apologies to the list for all that SPAM-LOW stuff. Terrible
netiquette. I have now got my ISP to knock that on the head.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden