imageNamed cannot load an image
imageNamed cannot load an image
- Subject: imageNamed cannot load an image
- From: Artemiy Pavlov <email@hidden>
- Date: Wed, 21 Mar 2007 20:07:56 +0200
Hello!
I have an image file SpaceOscillator.png which resides in my
"Resources" and in the Interface Builder as SpaceOscillator. When I
try to draw it, it just doesn't work: the code I use is below, and I
always get "Couldn't load background image".
Can anyone suggest what I should do?
Thanks very much,
Artemiy.
NSImage *BackgroundImage = [NSImage imageNamed:@"SpaceOscillator"];
if(BackgroundImage == nil){
printf("Couldn't load background image\n");
} else {
printf("Loaded background image\n");
}
[BackgroundImage drawAtPoint:NSMakePoint(0.0, 0.0)
fromRect: NSZeroRect
operation: NSCompositeSourceOver
fraction: 1.0];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden