• 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: How can a plug-in bundle get access to its own resources?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can a plug-in bundle get access to its own resources?


  • Subject: Re: How can a plug-in bundle get access to its own resources?
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 10 Nov 2009 13:08:53 +0000


On 10 Nov 2009, at 12:59, Motti Shneor wrote:

Thanks guys, but you may have not read all my message ---

The [NSBundle bundleForClass:[self class]];

is unusable for me, because I have many plugins that build from the same code, and export the same class (of course --- the same class name).

Obj-C has no name-spaces, and so, If you load 2 such plugins, and use the [NSBundle bundleForClass:[self class]] in each of them independently --- you'll get erroneous answers! both of them will return the same bundle although they come from different bundles.

This is hardly a system "bug" because there are no namespaces, and for the same class name there is only one bundle.

Any other ideas?

Yes, build your plug-ins with different class names. Doing otherwise will little the console with warnings. It's not too hard to setup a macro that takes the common classname and generates a unique one for each plug-in.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How can a plug-in bundle get access to its own resources? (From: Motti Shneor <email@hidden>)
 >Re: How can a plug-in bundle get access to its own resources? (From: Benjamin Miller <email@hidden>)
 >Re: How can a plug-in bundle get access to its own resources? (From: Kiel Gillard <email@hidden>)
 >Re: How can a plug-in bundle get access to its own resources? (From: Motti Shneor <email@hidden>)

  • Prev by Date: Re: How can a plug-in bundle get access to its own resources?
  • Next by Date: Re: cocoabuilder.com
  • Previous by thread: Re: How can a plug-in bundle get access to its own resources?
  • Next by thread: Re: How can a plug-in bundle get access to its own resources?
  • Index(es):
    • Date
    • Thread