• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: imageNamed cannot load an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: imageNamed cannot load an image
      • From: m <email@hidden>
References: 
 >Re: imageNamed cannot load an image (From: James Chen <email@hidden>)

  • Prev by Date: sending image through network
  • Next by Date: Compiler has trouble distinguishing between a class and its superclass
  • Previous by thread: Re: imageNamed cannot load an image
  • Next by thread: Re: imageNamed cannot load an image
  • Index(es):
    • Date
    • Thread