• 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: principle classes from two bundles get confused
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: principle classes from two bundles get confused


  • Subject: Re: principle classes from two bundles get confused
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 08 Nov 2009 22:02:21 -0800

On Nov 8, 2009, at 5:47 AM, Shai Shasag wrote:

> How could this be? I think the problem is that both bundle_A & bundle_B have principle class with the same name. Somehow Cocoa gets confused.

No "somehow" about it.  Objective-C does not support namespaces;  all classes (and selectors) exist within the same namespace.

If you were to look at the console log, you'd probably see a very specific message indicating where the two identically named classes came from.

> Why would two different bundles have principle classes with the same name you might ask?
> Well actually there are more than a hundred such bundles in my project. Each bundle is a plugin that follows the same API. If I was to write a different principle class for each it would be a nightmare to maintain.
>
> Is there a way to tell Cocoa to use the class from each bundle regardless that they both have the same name?

Yes -- name the classes differently.   Some folks use a #define to vary the class name per bundle.

And please file a bug via http://bugreport.apple.com/ asking for a solution to this particular issue.  You could copy and paste your original message into the bug report, if you want.

b.bum

_______________________________________________

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: 
 >principle classes from two bundles get confused (From: Shai Shasag <email@hidden>)

  • Prev by Date: Re: NSTreeController and object retain counts
  • Next by Date: Simulating mouse events
  • Previous by thread: principle classes from two bundles get confused
  • Next by thread: beginner question, NSNumber, NSDecimalAsNumber
  • Index(es):
    • Date
    • Thread