Re: imageNamed cannot load an image
Re: imageNamed cannot load an image
- Subject: Re: imageNamed cannot load an image
- From: m <email@hidden>
- Date: Thu, 22 Mar 2007 13:15:13 +0200
On Mar 22, 2007, at 12:40 PM, Artemiy Pavlov wrote:
I tried this:
NSString* BackgroundImageName = [[NSBundle
bundleWithIdentifier:@"com.Sinevibes.audiounit.SpaceOscillator"]
pathForResource:@"SpaceOscillator" ofType:@"PNG"];
NSImage* BackgroundImage = [[NSImage alloc]
initWithContentsOfFile:BackgroundImageName];
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
_______________________________________________
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