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 12:40:22 +0200
James,
I tried this:
NSString* BackgroundImageName = [[NSBundle
bundleWithIdentifier:@"com.Sinevibes.audiounit.SpaceOscillator"]
pathForResource:@"SpaceOscillator" ofType:@"PNG"];
NSImage* BackgroundImage = [[NSImage alloc]
initWithContentsOfFile:BackgroundImageName];
The file SpaceOscillator.png is now part of both the main and the
view bundles. But BackgroundImage is nil...
:-/
Thanks for the help,
Artemiy.
On 22 Mar 2007, at 11:56 AM, James Chen wrote:
Hello,
I think [NSBundle bundleWithIdentifier:] might help.
[[NSBundle bundleWithIdentifier:@"com.your_company.bundleID"]
pathForResource:@"SpaceOscillator" ofType:@"PNG"];
_______________________________________________
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