Images in bundles
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."