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


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

  • Prev by Date: Re: Compiler has trouble distinguishing between a class and its superclass
  • Next by Date: Re: Need help setting up KVO
  • Previous by thread: Re: imageNamed cannot load an image
  • Next by thread: Re: imageNamed cannot load an image
  • Index(es):
    • Date
    • Thread