Re: Error with [pluginBundle infoDictionary]
Re: Error with [pluginBundle infoDictionary]
- Subject: Re: Error with [pluginBundle infoDictionary]
- From: Trygve Inda <email@hidden>
- Date: Tue, 17 Oct 2006 04:32:29 +0000
- Thread-topic: Error with [pluginBundle infoDictionary]
> On 10/16/06, Trygve Inda <email@hidden> wrote:
>>
>> It looks like I have to use NSFileManager for the directory contents and
>> then manually determine the extension name... pathsForResourcesOfType does
>> something to mess this all up.
>>
>> Trygve
>
> I tried switching to using NSFileManager but the infoDictionary for
> any found bundle is still missing all of the attributes in the
> Info.plist. The entire dictionary is something like:
> NSBundleResolvedPath = /Users/coconnor/Development/Pie
> Menus/build/Debug/Needs More
> Switches.app/Contents/Resources/Themes/Horizontal.nmstheme;
> NSBundleResourcePath = /Users/coconnor/Development/Pie
> Menus/build/Debug/Needs More
> Switches.app/Contents/Resources/Themes/Horizontal.nmstheme/Resources;
> NSBundleLanguagesList = <NSCFArray 0x35c610>(
> )
> ;
> NSBundleInitialPath = /Users/coconnor/Development/Pie
> Menus/build/Debug/Needs More
> Switches.app/Contents/Resources/Themes/Horizontal.nmstheme;
> }
>
> Which does not contain the 5 other properties that are in the
> Info.plist. Does anybody know another reason NSBundle's infoDictionary
> method would not return the actual Info.plist? Should I assume it's
> broken and just manually load the Info.plist file?
>
> -Corey
Hi Corey,
NSFileManager worked for me.... And I had the same results as you list above
with pathforResourcesOfType.
bundlePathsEnum = [bundlePaths objectEnumerator];
while (folderPath = [bundlePathsEnum nextObject])
{
NSEnumerator* enumerator = [[[NSFileManager defaultManager]
directoryContentsAtPath:folderPath] objectEnumerator];
NSString* pluginPath;
while ((pluginPath = [enumerator nextObject]))
{
if ([[pluginPath pathExtension] isEqualToString:@"myextension"])
{
pluginPath = [[folderPath stringByAppendingString:@"/"]
stringByAppendingString:pluginPath];
// Then this can be called
NSBundle* pluginBundle = [NSBundle bundleWithPath:path];
NSDictionary* pluginDict = [pluginBundle infoDictionary];
}
}
}
}
_______________________________________________
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