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

Images in bundles


  • Subject: Images in bundles
  • From: Angela Brett <email@hidden>
  • Date: Wed, 24 Oct 2001 23:19:10 +1300

Hi,

I've just decided to learn to make ScreenSavers. I found a great tutorial on CocoaDevCentral on how to do it, so I have the basics set up properly. I got their example code with NSBezierPaths to work with no problems.

My problem is, how do I use an image in my screensaver? I have added some images to the project. I first tried using

theImage=[NSImage imageNamed:@"theImageName"];

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?
--
Angela Brett email@hidden http://acronyms.co.nz/angela
"Great minds think different."


  • Follow-Ups:
    • Re: Images in bundles
      • From: Raphael Sebbe <email@hidden>
    • Re: Images in bundles
      • From: j o a r <email@hidden>
  • Prev by Date: mousemoved event in prefpane
  • Next by Date: Re: KeyDown event
  • Previous by thread: mousemoved event in prefpane
  • Next by thread: Re: Images in bundles
  • Index(es):
    • Date
    • Thread