• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: shared NSImage from bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >shared NSImage from bundle (From: Torsten Curdt <email@hidden>)
 >Re: shared NSImage from bundle (From: Jean-Daniel Dupas <email@hidden>)
 >Re: shared NSImage from bundle (From: Torsten Curdt <email@hidden>)

  • Prev by Date: [SOLVED] Re: What is [NSTextStorage fontSetChanged]?
  • Next by Date: Re: What is the status on the New Cocoa 2.0 Books?
  • Previous by thread: Re: shared NSImage from bundle
  • Next by thread: Quit application when window closes
  • Index(es):
    • Date
    • Thread