faqts : Computers : Programming : Application Frameworks : Macintosh : Cocoa

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 4 people (100%) answered Yes
Recently 4 of 4 people (100%) answered Yes

Entry

Can I include a framework in an application?

Apr 28th, 2002 22:39
Christopher Holland,


Yes.
In order to do this the Framework must be compiled correctly first. 
In the build settings tab for the Framework find the "Installation
Location" setting and select "Path:" then put the following
in for the path:
   @executable_path/../Frameworks
Next, you will probably want to enable pre-binding for your application. 
In order to do this, your framework must load in a different memory
segment than the default. To set this, change the OTHER_LDFLAGS build
setting to something like:
   -seg1addr 0xff0000
Now you can build the framework and it will be ready for inclusion in
applications. But, you then must tell your application to include it
when it builds. To do this simply click on the Application project's
"Files & Build Phases" tab. Then use the menu item "Project->New Build
Phase->New Copy Files Build Phase" to add another build phase to the
project. The new build phase will show up in the tab and you will 
change the pull-down menu to "Frameworks". Then drag the Framework
(which should already be part of your project in the File List pane)
into the "Files" area of the Copy Files build phase area.
That last part sounds confusing, but when you see it you will
understand.
Now, when you build your application, there will be a "Frameworks"
directory with the included frameworks put in there (you'll have to
right-click and select "Show Package Contents" to see the stuff
inside your application bundle.