embedding private frameworks in Xcode 2.1
embedding private frameworks in Xcode 2.1
- Subject: embedding private frameworks in Xcode 2.1
- From: Jesse Grosjean <email@hidden>
- Date: Fri, 17 Jun 2005 11:31:42 -0400
I'm trying to figure out the correct way to develop a framework in
one Xcode project and an application that depends on and embeds that
framework in another Xcode project. I'm mostly following the
instructions on this site:
http://rentzsch.com/share/embeddingFrameworks.mov
But I have some questions as of Xcode 2.1. In general please let me
know if I'm doing anything extra that isn't really needed, or not
doing something that's a good idea to do. Here's what I'm doing:
1. Create Cocoa Framework project.
2. Create MyClass, make header public
3. Change framework target install directory to @executable_path/../
Frameworks
4. Create Cocoa app project
5. Drag and drop MyFramework.xcodeproj into MyApp.xcodeproj so I can
add dependencies
6. Inspect MyApp's target and add MyFramework from the referenced
MyFramework.xcodeproj as a direct dependency.
This is where I start having questions:
First on this page http://developer.apple.com/documentation/MacOSX/
Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html I found this note:
"Note: Including both targets in the same project is highly
recommended as it lets you take advantage of Xcode’s dependency
analysis when building your application. While it is possible to
build the two targets from separate projects, if you do, you must
track the dependencies manually or with a custom script."
Is this out of date? It seems like dependencies are tracked OK using
the above method, and then adding the framework as a dependency to my
application. I don't want to put the framework in the same project as
my application, because I have multiple applications that want to use
and embed my framework.
Next in the embeddingFrameworks.mov tutorial it says to drag and drop
MyFramework.framework from the build directory of the
MyFramework.xcodeproj project into the Linked Frameworks folder of
the MyApp project. The problem is that as of Xcode 2.1 there are
multiple locations for this file (Debug, or Release). I'm not sure
which to use and ideally I would like to use the Debug version when
I'm compiling MyApp in debug configuration and the Release version
when I'm compiling my app in Release configuration. This is
especially important for the copy frameworks build phase, I want the
framework with the matching configuration added into my app bundle.
7. To get around this problem I'm NOT placing MyFramework.framework
in the "Linked Frameworks" folder. Instead I've found that in MyApp's
"Groups & Files" pane there is a draggle reference to
MyFramework.framework under the referenced MyFramework.xcodeproj
project. I can drag this into the MyApp target's "Link Binary With
Libraries" and this "Copy Files" build phases.
This does seem to work, but I haven't seen it documented anywhere, it
also seems to require that both projects use the same location for
"Place Build Products In".
So is this an OK way to do things, or are there better methods?
Thanks,
Jesse
_______________________________________________
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