• 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: Images in bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Images in bundles


  • Subject: Re: Images in bundles
  • From: j o a r <email@hidden>
  • Date: Wed, 24 Oct 2001 15:23:25 +0200

On Wednesday, October 24, 2001, at 12:19 , Angela Brett wrote:

which is what I've used successfully in my other projects. That didn't work (theImage was nil), which I guessed was because imageNamed looks in the main bundle of an application, and this is only a bundle by itself.
Then I tried:
theImage=[[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"theImageName.gif"]];
That way, theImage was not nil, but [theImage isValid] returned NO. What am I missing?

mainBundle probably refers to the bundle of the screen saver application, not your screen saver "plugin". Try something like this instead:

NSBundle *thisBundle = [NSBundle bundleForClass:[self class]];
NSArray *images = [thisBundle pathsForResourcesOfType:@"tiff" inDirectory:nil];

Regards,

j o a r


References: 
 >Images in bundles (From: Angela Brett <email@hidden>)

  • Prev by Date: Re: Drag and drop-folders
  • Next by Date: Re: Images in bundles
  • Previous by thread: Images in bundles
  • Next by thread: Re: Images in bundles
  • Index(es):
    • Date
    • Thread