Re: Error with [pluginBundle infoDictionary]
Re: Error with [pluginBundle infoDictionary]
- Subject: Re: Error with [pluginBundle infoDictionary]
- From: Trygve Inda <email@hidden>
- Date: Mon, 16 Oct 2006 06:09:38 +0000
- Thread-topic: Error with [pluginBundle infoDictionary]
A follow up here....
- (void)testLoadPlugins
{
NSEnumerator*
enu = [[NSBundle pathsForResourcesOfType:@"plugin"
inDirectory:[[NSBundle mainBundle] builtInPlugInsPath]]
objectEnumerator];
NSString* pluginPath;
while ((pluginPath = [enu nextObject]))
{
NSBundle* pluginBundle = [NSBundle bundleWithPath:pluginPath];
if (pluginBundle)
{
NSDictionary* pluginDict = [pluginBundle infoDictionary];
NSString* pluginName = [pluginDict objectForKey:@"NSPrincipalClass"];
}
}
}
If I run this method once with a single plugin in the /Contents/PlugIns
folder of my app bundle, it works fine... pluginDict ends up with 17 keys.
However, if I then add a second plugin file to the /Contents/PlugIns folder,
and run this method again, the original plugin still shows 17 keys, but the
new plugin only shows 4 keys which is wrong - its Info.plist also has 17
keys.
Note the same thing happens is I run it once with zero plugins and than run
it again with plugins present... They only show 4 keys and do not as
NSPrincipalClass is not one of them, it fails.
What is wrong here?
Is pathsForResourcesOfType somehow caching things so I can't rescan a folder
to load plugins?
Trygve
_______________________________________________
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