• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Re: Error with [pluginBundle infoDictionary]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Error with [pluginBundle infoDictionary]


  • Subject: Re: Re: Error with [pluginBundle infoDictionary]
  • From: "Corey O'Connor" <email@hidden>
  • Date: Tue, 17 Oct 2006 07:11:20 -0700

On 10/16/06, Trygve Inda <email@hidden> wrote:
>
> 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:
...
> 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?

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];


} } } }

That's about what I ended up using, except I still had to load the Info.plist manually. So where: NSDictionary* pluginDict = [pluginBundle infoDictionary];

I have:
NSString* info_path = [[pluginBundle bundlePath]
stringByAppendingPathComponent: @"Info.plist"];
	NSDictionary* pluginDict = [NSDictionary
dictionaryWithContentsOfFile: info_path];

I have no idea why this was required, but otherwise I can't read the
properties out of the Info.plist. Ah well.

--
-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


References: 
 >Re: Re: Error with [pluginBundle infoDictionary] (From: "Corey O'Connor" <email@hidden>)
 >Re: Error with [pluginBundle infoDictionary] (From: Trygve Inda <email@hidden>)

  • Prev by Date: Signed incoherences with NSTableView indexes
  • Next by Date: Re: Signed incoherences with NSTableView indexes
  • Previous by thread: Re: Error with [pluginBundle infoDictionary]
  • Next by thread: get iTunes songs
  • Index(es):
    • Date
    • Thread