Re: Re: Error with [pluginBundle infoDictionary]
Re: Re: Error with [pluginBundle infoDictionary]
- Subject: Re: Re: Error with [pluginBundle infoDictionary]
- From: "Corey O'Connor" <email@hidden>
- Date: Mon, 16 Oct 2006 02:14:16 -0700
No solution, but I'm also experiencing the exact same problem. In my
case no plugin located with pathsForResourcesOfType has a proper
infoDictionary. Though the NSBundle instances for each plugin claim to
be correct.
-Corey
On 10/15/06, Trygve Inda <email@hidden> wrote:
Sorry,
The explanation below is fixed... The previous one was all wonky. :-)
- (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 gets 17 keys.
However, if I 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 that the same thing happens if I run it once with zero plugins and then
run it again with plugins present... pluginDict only gets 4 keys and since
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
--
-Corey O'Connor
_______________________________________________
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