Re: +bundleForClass: category question
Re: +bundleForClass: category question
- Subject: Re: +bundleForClass: category question
- From: David Duncan <email@hidden>
- Date: Sun, 15 Jul 2012 20:29:31 -0700
On Jul 15, 2012, at 7:30 PM, Graham Cox <email@hidden> wrote:
> If I create a category on a standard framework class as part of another framework, and I use +[NSBundle bundleForClass:] to load an image resource for use by that category, does that work, i.e. does it load the bundle of the framework containing the category, or the bundle containing the original class being extended?
The category is a method on the class you specify, therefore [self class] will be that class (whatever it is) and you will get the bundle for that class. In this case, it means your bundle will be the framework bundle.
--
David Duncan
_______________________________________________
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