Re: +bundleForClass: category question

2012-07-21 Thread Uli Kusterer
On 16.07.2012, at 04:30, Graham Cox 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

Re: +bundleForClass: category question

2012-07-16 Thread Jens Alfke
On Jul 15, 2012, at 8:29 PM, David Duncan david.dun...@apple.com wrote: 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.

Re: +bundleForClass: category question

2012-07-16 Thread Dave DeLong
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

Re: +bundleForClass: category question

2012-07-16 Thread Graham Cox
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

Re: +bundleForClass: category question

2012-07-16 Thread Kyle Sluder
On Tue, Jul 17, 2012, at 11:02 AM, Graham Cox wrote: 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

Re: +bundleForClass: category question

2012-07-16 Thread Jens Alfke
On Jul 16, 2012, at 6:02 PM, Graham Cox graham@bigpond.com wrote: 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: category question

2012-07-15 Thread Graham Cox
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

Re: +bundleForClass: category question

2012-07-15 Thread David Duncan
On Jul 15, 2012, at 7:30 PM, Graham Cox graham@bigpond.com 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

Re: +bundleForClass: category question

2012-07-15 Thread Graham Cox
On 16/07/2012, at 1:29 PM, David Duncan wrote: In this case, it means your bundle will be the framework bundle. Just to be clear, you mean the bundle for the *original* framework (AppKit, say) and not my framework which contains the category? --Graham

Re: +bundleForClass: category question

2012-07-15 Thread David Duncan
On Jul 15, 2012, at 9:07 PM, Graham Cox graham@bigpond.com wrote: On 16/07/2012, at 1:29 PM, David Duncan wrote: In this case, it means your bundle will be the framework bundle. Just to be clear, you mean the bundle for the *original* framework (AppKit, say) and not my framework