Re: loading executable code, NSBundle
Re: loading executable code, NSBundle
- Subject: Re: loading executable code, NSBundle
- From: Douglas Davidson <email@hidden>
- Date: Wed, 2 May 2001 12:15:03 -0700
On Tuesday, May 1, 2001, at 06:41 PM, Andreas Wolf wrote:
Yes, I wanted to Bundle an entire Application.
It needed to be recompiled as a Bundle, i.e. with the BNDL flag in PB.
Other than that no changes were necessary. I left the main function
and the main nib file in the Project.
NSBundle loaded the app flawlessly (behind the scenes it is no longer
an app, is it?).
The behavior you see here is that of Mach-o binaries. There are many
different types of Mach-o binaries, but the three you will see most
often are stand-alone executables, dynamic shared libraries, and
loadable bundles. These three all have different behaviors:
stand-alone executables can be executed but not loaded; dynamic shared
libraries can be loaded, but not unloaded or executed; bundles can be
loaded and unloaded, but not executed. There are also a number of other
subtler differences. Your application bundle had a Mach-o stand-alone
executable as its binary, so it could not be loaded. When you changed
it to a bundle, it was compiled to have a Mach-o loadable bundle as its
binary, so it could then be loaded.
Douglas Davidson