Re: ScreenSaver & Bundles
Re: ScreenSaver & Bundles
- Subject: Re: ScreenSaver & Bundles
- From: Ondra Cada <email@hidden>
- Date: Thu, 11 Apr 2002 01:43:39 +0200
On Wednesday, April 10, 2002, at 10:57 , Michael P. Rogers wrote:
I'm trying to bring an image in my resources folder into a
ScreenSaverView. But this code:
imagePath = [ [NSBundle mainBundle]pathForResource:@"map" ofType:@"gif"]
;
gets me null, although map.gif is in the resources folder of my .saver.
Hmmm... I haven't done savers yet, but I guess a saver is not an
application by itself, but just a loadable bundle used by some other app?
If so, the behaviour is quite all right. You don't want the main bundle
(which represents the main app which loads your bundle); you want the
bundle of your .saver. The most common way would be something like
[NSBundle bundleForClass:[self class]]
See NSBundle docs for more.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.