Re: Custom embedded framework not working [Solved]
Re: Custom embedded framework not working [Solved]
- Subject: Re: Custom embedded framework not working [Solved]
- From: "Kyle Sluder" <email@hidden>
- Date: Sat, 28 Jul 2007 15:51:12 -0400
Not too long ago I was struggling with the same apparent problem,
until I actually figured out what @executable_path does.
@executable_path isn't parsed at compile time, it's parsed by the
loader; the linker stores @executable_path/../Frameworks verbatim in
the object file. So there's no problem, because @executable_path will
always point to the current executable's image, and embedded
frameworks will always be located in the Frameworks directory in the
bundle, no matter where the user wants to put your .app bundle.
--Kyle Sluder
On 7/28/07, Ken Tozier <email@hidden> wrote:
> After an hour's more futzing, I finally got it working. For others in
> the same boat, here are the magic incantations
>
> In the framework project
> 1. Select you framework under "Groups and Files>Targets"
> 2. Do a "get info" in the target
> 3. Select the "Build" tab
> 4. Select "Deployment" option in the "Collection" popup
> 5. Change the "Installation directory" field to "@executable_path/../
> frameworks"
> 6. Build the framework
>
> In the application that embeds the framework
> 1. Select "Frameworks > Linked Frameworks" under "Groups & Files"
> 2. Control-click to bring up the contextual menu and select "Add >
> Existing Frameworks"
> 3. Navigate to your framework's build folder and select <framework
> name>.framework.
> 4. Create a "Copy files" build phase and drag the framework icon into it
>
> Done.
>
> While this solves the embedding problem, it still requires framework
> projects to specify their deploy location. There must be a way to
> embed a framework without this customization so if anyone knows of a
> way, it would be a big help
>
> Ken
>
> On Jul 28, 2007, at 2:09 PM, Ken Tozier wrote:
>
> > Hi
> >
> > I'm taking my first foray into creating custom frameworks and while
> > they work fine if I manually place them in "/Library/frameworks/"
> > I'm having no luck embedding them in an application.
> >
> > I read the relevant documentation here http://developer.apple.com/
> > documentation/MacOSX/Conceptual/BPFrameworks/Tasks/
> > CreatingFrameworks.html#//apple_ref/doc/uid/20002258-106880,
> > Googled, read any links that looked promising, watched this video
> > at http://rentzsch.com/share/embeddingFrameworks.mov (although that
> > seems to be out of date as it specified using -seg1addr in the
> > other linker flags ) but I'm clearly doing something wrong.
> >
> > First question I have regards the documentation stating that you
> > have to set the build targets of both the app and the framework to
> > the same directory. Is that correct? If so, doesn't that mean that
> > anyone who wants to use a custom framework has to have the complete
> > source and customize the build settings of all custom framework
> > projects for each application they want to use it in? That just
> > seems suspect as no one other than the original framework developer
> > could ever embed a non-apple framework.
> >
> > Second question: When I followed the Apple instructions at the
> > above link, I got a link error that no amount of "build path"
> > twiddling was able to fix.
> >
> > I ended up using a combination of the rentzsch.com method for
> > adding the framework to the (control>add>existing frameworks) along
> > with the adding a "copy files" build phase. All the public headers
> > are flagged correctly.
> >
> > When I run the app I get the error "/Library/Frameworks/
> > KViews.framework/Versions/A/KViews." I can't understand why this is
> > happening as the compiled app contains the KViews.framework in it's
> > embedded frameworks folder.
> >
> > Any insights greatly appreciated
> >
> > Ken
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Xcode-users mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40comcast.net
> >
> > This email sent to email@hidden
>
_______________________________________________
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