or Using NSImage... [was: Re: Using NSBundle]
or Using NSImage... [was: Re: Using NSBundle]
- Subject: or Using NSImage... [was: Re: Using NSBundle]
- From: Graham J Lee <email@hidden>
- Date: Sat, 19 Nov 2005 11:47:45 +0000
Graham J Lee wrote:
Hi,
I'm trying to write a toy screensaver in order to learn things about
drawing images and the like. However, I don't seem to be able to load
my image :-(. I'm doing this in -startAnimation
- (void)startAnimation
{
[super startAnimation];
[theImage initWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:@"oxford-physics-apple" ofType:@"png"]];
[theImage setSize:aSize];
}
Have done some more snooping. The path at initWithContentsOfFile: is
correct, however it's returning nil. Why would that be? The file is
readable, and contains valid data (it opens in e.g. Preview).
Thanks,
Graham.
--
Graham Lee
UNIX Systems Manager,
Oxford Physics Practical Course
http://users.ox.ac.uk/~wadh1342
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden