Re: Trouble loading bundles at runtime
Re: Trouble loading bundles at runtime
- Subject: Re: Trouble loading bundles at runtime
- From: Alexander Griekspoor <email@hidden>
- Date: Wed, 6 Feb 2008 22:20:50 +0000
Hi Jon,
I tried that but that doesn't make a different, I also believe that
the call [pluginBundle principalClass] loads the bundle according to
the docs.
The problem seems in the cached plist which somehow is incomplete. But
even if I load the plist using the filemanager like suggested
previously on the list I can't get the nib to load, neither using
loadNibNamed, nor even using NSNib initWithContentsOfURL. It seems the
bundle is somehow crippled/cached and needs to be refreshed to bring
it in the state it is when I would quit my app and relaunch it..
Alex
Hey Alexander -
I'm not sure that this is your problem, but I would expect to see a
call to [pluginBundle load] right after pluginBundle is set to
[NSBundle bundleWithPath: path]. Having an instance of NSBundle
doesn't imply that the code for the bundle has been loaded into your
address space.
Jon Hess
The weird thing is that this only happens if I just before have
download the bundle and wrote it to disk. If I restart my main app
and use the exact same code to load the bundle it works fine. What
happens is that instead of the bundle's nib file the main app's nib
is loaded again!?! Diving a bit further into it shows that this is
because the [pluginBundle infoDictionary] doesn't contain the
complete plist of the bundle (although it definitely is there!) and
lacks the NSMainNibFile entry.
If I run this code at startup the plist looks like:
dict: {
CFBundleDevelopmentRegion = English;
CFBundleExecutable = WOSSearchEngine;
CFBundleExecutablePath = "/Users/griek/Library/Application
Support/Papers/PlugIns/SearchEngines/WOSSearchEngine.searchengine/
Contents/MacOS/WOSSearchEngine";
CFBundleIconFile = searchengine;
CFBundleIdentifier = "com.mekentosj.papers.WOSSearchEngine";
CFBundleInfoDictionaryVersion = "6.0";
CFBundleInfoPlistURL = Contents/Info.plist -- file://localhost/Users/griek/Library/Application Support/Papers/PlugIns/SearchEngines/WOSSearchEngine.searchengine/
;
CFBundleNumericVersion = 18907136;
CFBundlePackageType = BNDL;
CFBundleSignature = MTPX;
CFBundleVersion = "1.2";
NSBundleInitialPath = "/Users/griek/Library/Application Support/
Papers/PlugIns/SearchEngines/WOSSearchEngine.searchengine";
NSBundleResolvedPath = "/Users/griek/Library/Application Support/
Papers/PlugIns/SearchEngines/WOSSearchEngine.searchengine";
NSMainNibFile = Panel;
NSPrincipalClass = mtWOSSearchEngine;
}
while at runtime and just after downloading the bundle it looks like:
dict: {
CFBundleExecutablePath = "/Users/griek/Library/Application
Support/Papers/PlugIns/SearchEngines/
CiteseerSearchEngine.searchengine/Contents/MacOS/
CiteseerSearchEngine";
NSBundleInitialPath = "/Users/griek/Library/Application Support/
Papers/PlugIns/SearchEngines/CiteseerSearchEngine.searchengine";
NSBundleResolvedPath = "/Users/griek/Library/Application Support/
Papers/PlugIns/SearchEngines/CiteseerSearchEngine.searchengine";
NSPrincipalClass = mtCiteseerSearchEngine;
}
I'm quite running out of ideas what is going on. The more because
in addition the gcc debugger seems to have problems with this on
its own:
BFD: BFD 2.16.91 20050815 internal error, aborting at /SourceCache/
gdb/gdb-768/src/bfd/cache.c line 517 in bfd_cache_lookup_worker
BFD: Please report this bug.
The Debugger has exited with status 1.The Debugger has exited with
status 1.
Anyone a clue of what's going on? Any help is appreciated!
Alex
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
**********************************************
** Alexander Griekspoor PhD **
**********************************************
mekentosj.com
4Peaks - For Peaks, Four Peaks
2004 Winner of the Apple Design Awards
Best Mac OS X Student Product
http://www.mekentosj.com/4peaks
**********************************************
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden