Embedding a Private Framework into a Mac OS X Application Bundle

Mac OS X framework files usually reside in /Library/Frameworks or in ~/Library/Frameworks.

A private framework can also be installed into the Frameworks folder in the Application Bundle, for example:

Screen shot 2011-10-03 at 12.55.51 PM

This is easily done in a Copy Files build phase. With Xcode 3, follow the following steps.

1) select the
Build Target in Xcode

Screen shot 2011-10-03 at 12.59.30 PM

2) go to the Xcode
Project Menu, and select New Build Phase > New Copy Files Build Phase:

copyfile

You will see this
Copy Files Phase window:

Screen shot 2011-10-03 at 1.08.08 PM

3) Select
Frameworks item in the Destination popup menu:

Screen shot 2011-10-03 at 1.09.05 PM

This will add a Copy Files phase to your target:

copy

4) Now drag your private framework (from Linked Frameworks or Other Framework) into the Copy Files phase:

Screen shot 2011-10-03 at 1.15.30 PM

That is all there is to it. The next time you build your application, the Application Bundle will contain a Frameworks folder with your private framework in it, as shown in the first figure above.