Skip navigation.
 
mlRe: shared NSImage from bundle
FROM : Jim Puls
DATE : Thu Mar 13 02:05:00 2008

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

Related mailsAuthorDate
mlshared NSImage from bundle Torsten Curdt Mar 11, 11:12
mlRe: shared NSImage from bundle Jean-Daniel Dupas Mar 11, 11:17
mlRe: shared NSImage from bundle Torsten Curdt Mar 11, 11:48
mlRe: shared NSImage from bundle Jim Puls Mar 13, 02:05