Re: NSPreferencePane with my own private framework?
Re: NSPreferencePane with my own private framework?
- Subject: Re: NSPreferencePane with my own private framework?
- From: "Sherm Pendley" <email@hidden>
- Date: Fri, 7 Mar 2008 16:26:29 -0500
On Fri, Mar 7, 2008 at 11:55 AM, Ryan Poling <
email@hidden> wrote:
Hi all,
Moving this question over from cocoa-dev since it seems to be more of
an Xcode issue.
I've been having a problem getting one of my private frameworks to
work correctly with a project which creates an NSPreferencePane for
use with System Preferences. Basically, as soon as I try to add my
framework to the project, System Preferences refuses to load the pane
with an error like the following logged to the console:
3/5/08 1:53:14 PM System Preferences[11649] Error loading /Users/ryan/
Library/PreferencePanes/Myprefpane.prefPane/Contents/MacOS/Myprefpane:
dlopen(/Users/ryan/Library/PreferencePanes/Myprefpane.prefPane/
Contents/MacOS/Myprefpane, 265): Library not loaded:
@executable_path/../Frameworks/MyFramework.framework/Versions/A/
MyFramework
Referenced from: /Users/ryan/Library/PreferencePanes/
Myprefpane.prefPane/Contents/MacOS/Myprefpane
Reason: image not found
First, you need to build your framework with an install_path that begins with @loader_path instead of @executable_path. Then, rebuild your prefpane - the framework's install_path is copied into your prefpane binary at link time, then at run time dyld uses the stored value to find the framework.
Based on Nick's suggestions from cocoa-dev, I've tried changing
various build settings to look in @loader_path/../Frameworks and
@bundle_path for the framework, but no luck yet.
I did see one suggestion (I don't recall who from) to add @loader_path to your framework search path. That's just wrong. @loader_path is not a compile or link time setting. Think about it - how could it be expanded at compile time for a framework, when the linker has no idea at that time what app (or pane) will be loading the framework?
It doesn't seem like this should really be that hard
It's not really - you just need to keep in mind that changing a framework's install_name is a two-step process. You also need to rebuild your app (or pane), so that it gets the new install_name copied into it from the updated framework.
sherm--
_______________________________________________
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