Re: Problem loading IB plugin [solved]
Re: Problem loading IB plugin [solved]
- Subject: Re: Problem loading IB plugin [solved]
- From: Jonathan Hess <email@hidden>
- Date: Thu, 22 Nov 2007 02:06:39 -0800
On Nov 21, 2007, at 6:21 AM, Rick Hoge wrote:
[...]
If I launch IB in the usual way however, and then open IB
Preferences and try to add the plugin bundle by clicking the +
sign, an alert panel opens with the following message:
The bundle “JUNK” could not be loaded because it is damaged or
missing necessary resources.
Try reinstalling the bundle.
[...]
Nothing like actually looking at the Console output - IB was logging
an error message indicating that the framework library, which it was
looking for in /Library/Frameworks/ was not being loaded. This is
an immediate giveaway.
The framework target specifies the installation location as /Library/
Frameworks/ - I was trying to load the plugin from the build folder
in my project, without putting a copy in the standard location. I
should have thought of this before - this has come up in previous
projects. It's a common reason for projects including loadable
bundles to stop working outside of Xcode if the bundles are kept
inside the application bundle. I have had to change the
installation location from /Library/Frameworks to
@executable_path/../Frameworks on a regular basis.
Hey Rick -
You nailed it. This works when you hit build and run in Xcode because
Xcode sets the DYLD_FRAMEWORK_PATH environment variable before
launching an executable to debug (IB). If you want to quickly load
your built plug-in, you can either install a symlink from /Library/
Frameworks/<YourFramework>.framework back to your built framework, or
you can launch IB from the terminal with DYLD_FRAMEWORK_PATH set to
your built products directory. The symlink is probably most convenient
here.
Once I put the framework in /Library/Frameworks/ , all worked as
advertised. A project linking against that framework gets the
plugin loaded automatically when you open a nib from that project.
The only other minor annoyance is that the views I want to support
in this way can't operate exclusively under Garbage Collection but
that's another matter... the views in question don't have
particularly complex memory management needs and you can still run
in GC mode when actually used in an app, right? It's just IB that
is not GC.
That's right, IB isn't a GC app, so your plug-in, and the frameworks
it links either have to be non-gc or hybrid.
About loading a plug-in into IB from the preference panel: You can
select either a ibplugin, or the top level folder for a framework. If
you choose a framework, IB will recursively search the framework for
ibplugs. IB doesn't actually load the framework itself, it just loads
the plugs. The plug-ins probably link the framework though, and that
would cause the framework to load when the plug-ins load. So, the
framework is only loaded by side-effect. If the framework isn't in the
install location, it won't be found, and this will result in the error
you've discovered.
Good luck with your plug-in -
Jon Hess
Rick _______________________________________________
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
_______________________________________________
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