Re: +bundleForClass: category question
Re: +bundleForClass: category question
- Subject: Re: +bundleForClass: category question
- From: Jens Alfke <email@hidden>
- Date: Mon, 16 Jul 2012 19:16:00 -0700
On Jul 16, 2012, at 6:02 PM, Graham Cox <email@hidden> 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 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.
Why not just make a subclass of NSCursor and put the accessor methods on that? It's safer than a category since you don't run the risk of colliding with a method name added by another framework/bundle in the same process, or by a future version of NSCursor itself.
—Jens
_______________________________________________
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