Re: Magic key for IB palettes?
Re: Magic key for IB palettes?
- Subject: Re: Magic key for IB palettes?
- From: Scott Ellsworth <email@hidden>
- Date: Mon, 20 Mar 2006 17:57:21 -0800
On Mar 14, 2006, at 1:30 PM, Ryan Britton wrote:
You need to change the library path referenced by the IB bundle. I
don't think there's a build setting you can do this with, but you
can do this with install_name_tool in a "Run Script" build phase.
Thanks for the tip, Ryan - I ended up using the script:
/usr/bin/install_name_tool -change @executable_path/../Frameworks/
LogicPuzzleHelper.framework/Versions/A/LogicPuzzleHelper
@loader_path/../Frameworks/LogicPuzzleHelper.framework/Versions/A/
LogicPuzzleHelper ${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/MacOS/$
{PRODUCT_NAME}
I just spent a while tearing out my hair, and was firmly convinced
that I needed to resolve @loader_path when a palette was loaded by
IB. I was still getting the 'image not found' error, and was
convinced it was a detail of @loader_path, when, as one would expect,
it was a simple config error.
Turns out it was pretty obvious in retrospect.
1. An IBPalette is a bundle. If you want a private embedded
framework to be found when that bundle is loaded, make sure you copy
it into the bundle with a copy files build phase. In other words,
having done that for your app does not by some magic let a bundle in
the same project know where it is. Duh.
2. Quit IB if you are testing bundle loading. Some things are
loaded just once in the life of a program, and you can get an out of
date version of your framework, perhaps with an out of date install
path, if you do not bounce IB after a load error.
Thanks again for the tip - once I thought about it, it worked just
great.
You can use otool -L to get the appropriate "old" path value for
the command. Just run it on the actual binary portion of the
bundle (in Product.someExt/Contents/MacOS/${PRODUCT_NAME}) and
it'll dump out all the linked libraries.
otool also was handy when I was trying to figure out why a class was
not being found properly. I really must spend some time learning
exactly what the options do.
Scott
On Mar 14, 2006, at 1:13 PM, Scott Ellsworth wrote:
Hi, all.
I have a framework that is designed to be embedded in the app
bundle, thus the framework path is @executable_path/../Frameworks
This works great for the app, but I also have a palette that wants
to use this class. If I use a framework path of Library/
Frameworks, IB does find it, but I want this framework to be
embedded in my app bundle.
Is there a similar magic variable that I can set in the palette
Info.plist that will tell IB where the framework is? I tried
adding /Users/work/Documents/coding/cocoa-heads/logicpuzzlehelper/
build/Debug to the FRAMEWORK_SEARCH_PATHS, but that did not help.
The error:
2006-03-14 13:10:19.085 Interface Builder[12505] *** -[NSBundle
load]: Error loading code /Users/work/Documents/coding/cocoa-heads/
logicpuzzlehelper/build/Debug/LogicPuzzleHelper.palette/Contents/
MacOS/LogicPuzzleHelper for bundle /Users/work/Documents/coding/
cocoa-heads/logicpuzzlehelper/build/Debug/
LogicPuzzleHelper.palette, error code 4 (link edit error code 4,
error number 0 (Library not loaded: @executable_path/../Frameworks/
LogicPuzzleHelperFramework.framework/Versions/A/
LogicPuzzleHelperFramework
Referenced from: /Users/work/Documents/coding/cocoa-heads/
logicpuzzlehelper/build/Debug/LogicPuzzleHelper.palette/Contents/
MacOS/LogicPuzzleHelper
Reason: image not found))
2006-03-14 13:10:19.085 Interface Builder[12505] unable to find
class LogicPuzzleHelperPalette
Which tells me that @executable_path is not being resolved as I
would like it to be.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden