Re: shared NSImage from bundle
Re: shared NSImage from bundle
- Subject: Re: shared NSImage from bundle
- From: Jim Puls <email@hidden>
- Date: Wed, 12 Mar 2008 18:05:00 -0700
On Mar 11, 2008, at 3:48 AM, Torsten Curdt wrote:
Thanks!! Perfect
On 11.03.2008, at 11:17, Jean-Daniel Dupas wrote:
The method your looking for is
+ (void)initialize { }
Warning: This method can be called more than once (if a subclass
does not override it) so you should do something like this.
@implementation Foo
+ (void)initialize {
if ([Foo class] == self) {
// load your images here.
}
}
I think you're trying too hard. Take a look at the docs for +[NSImage
imageNamed:], which does exactly what you want and does its own
caching, too.
-> jp
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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