Re: imageNamed cannot load an image
Re: imageNamed cannot load an image
- Subject: Re: imageNamed cannot load an image
- From: Artemiy Pavlov <email@hidden>
- Date: Thu, 22 Mar 2007 14:35:03 +0200
On 22 Mar 2007, at 1:15 PM, m wrote:
The obvious things to check here are whether your call to [NSBundle
bundleWithIdentifier:ofType:] is returning a bundle, and whether
BackgroundImageName contains something sensible. You might also try
lowercasing your type parameter.
Other things to try to ensure you're getting the right bundle:
- make sure the bundle is loaded
- once loaded, use [NSBundle bundleForClass:] with a class defined
in your bundle (this avoids any possible bundle ID snafus) to get a
reference to your bundle.
_murat
Murat, thank you VERY much. This one worked:
NSString* BackgroundImageName = [[NSBundle
bundleForClass:@"SpaceOscillatorViewFactory"]
pathForResource:@"SpaceOscillator" ofType:@"png"];
I also had to use "png" instead of "PNG". The image is now in the view!
Kindest regards,
Artemiy.
_______________________________________________
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