Nicko
2002.12.16, 03:37 PM
I have been working on writing a screensaver, and before I draw I need to load a resource contained in the bundle. The way I would do this in a normal cocoa application is something like this;
[NSString stringWithFormat:@"%@/%s", [[NSBundle mainBundle] resourcePath], "Picture.bmp"]
and that gives me the path to my picture, whereupon I can load it into memory.
However, when I try and do that in a screen saver, then instead of giving me the path to my screen saver's bundle, it gives me the path to the screen saver engine's bundle.
Does anyone know of a way of getting the path to the screen saver's bundle?
[NSString stringWithFormat:@"%@/%s", [[NSBundle mainBundle] resourcePath], "Picture.bmp"]
and that gives me the path to my picture, whereupon I can load it into memory.
However, when I try and do that in a screen saver, then instead of giving me the path to my screen saver's bundle, it gives me the path to the screen saver engine's bundle.
Does anyone know of a way of getting the path to the screen saver's bundle?