• 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: +bundleForClass: category question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +bundleForClass: category question


  • Subject: Re: +bundleForClass: category question
  • From: Graham Cox <email@hidden>
  • Date: Tue, 17 Jul 2012 11:02:09 +1000

On 17/07/2012, at 7:15 AM, Dave DeLong wrote:

> The answer is simple, and it's answered by the name of the method:
>
> -bundleForClass:
>
> Graham's framework does not define the class.  Therefore, it is not the bundle that is returned from the method.  This method returns the bundle that defines the class.  In Graham's example, it would be the system framework.


That was my assumption, so the answer was what I expected. But I also wondered whether it was possibly a bit smarter and used the full category name as the class name.

What I'm trying to do is to add a couple of cursors to NSCursor using a category which are created by loading images from the framework's resources. Unfortunately it doesn't work when implemented in a simple way because +bundleForClass returns the bundle containing NSCursor. Instead I have to declare an intermediate class that loads the image resource for me - I was just hoping to avoid that extra step but seems not.

--Graham


_______________________________________________

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

  • Follow-Ups:
    • Re: +bundleForClass: category question
      • From: Jens Alfke <email@hidden>
    • Re: +bundleForClass: category question
      • From: Kyle Sluder <email@hidden>
References: 
 >+bundleForClass: category question (From: Graham Cox <email@hidden>)
 >Re: +bundleForClass: category question (From: David Duncan <email@hidden>)
 >Re: +bundleForClass: category question (From: Jens Alfke <email@hidden>)
 >Re: +bundleForClass: category question (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Perplexing crash in iOS app, on observing an NSOperation
  • Next by Date: Re: +bundleForClass: category question
  • Previous by thread: Re: +bundleForClass: category question
  • Next by thread: Re: +bundleForClass: category question
  • Index(es):
    • Date
    • Thread