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


  • Follow-Ups:
    • Re: Error with [pluginBundle infoDictionary]
      • From: Trygve Inda <email@hidden>
References: 
 >Re: Error with [pluginBundle infoDictionary] (From: Trygve Inda <email@hidden>)
 >Re: Error with [pluginBundle infoDictionary] (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: NSImage Memory Management: To Page Or Not To Page.
  • Next by Date: Re: Where to find free EULA Templates?
  • Previous by thread: Re: Error with [pluginBundle infoDictionary]
  • Next by thread: Re: Error with [pluginBundle infoDictionary]
  • Index(es):
    • Date
    • Thread