• 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: 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


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

  • Prev by Date: Re: Compiler has trouble distinguishing between a class and its superclass
  • Next by Date: Re: 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