• 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
or Using NSImage... [was: Re: Using NSBundle]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

or Using NSImage... [was: Re: Using NSBundle]


  • Subject: or Using NSImage... [was: Re: Using NSBundle]
  • From: Graham J Lee <email@hidden>
  • Date: Sat, 19 Nov 2005 11:47:45 +0000

Graham J Lee wrote:
Hi,

I'm trying to write a toy screensaver in order to learn things about drawing images and the like. However, I don't seem to be able to load my image :-(. I'm doing this in -startAnimation

- (void)startAnimation
{
[super startAnimation];
[theImage initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"oxford-physics-apple" ofType:@"png"]];
[theImage setSize:aSize];
}


Have done some more snooping. The path at initWithContentsOfFile: is correct, however it's returning nil. Why would that be? The file is readable, and contains valid data (it opens in e.g. Preview).


Thanks,

Graham.
--
Graham Lee
UNIX Systems Manager,
Oxford Physics Practical Course
http://users.ox.ac.uk/~wadh1342
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: or Using NSImage... [was: Re: Using NSBundle]
      • From: Matthias Winkelmann <email@hidden>
References: 
 >Using NSBundle (From: Graham J Lee <email@hidden>)

  • Prev by Date: The best way to learn about low level Thread
  • Next by Date: Re: Problems making a framework (was tabbed class like Safari)
  • Previous by thread: Using NSBundle
  • Next by thread: Re: or Using NSImage... [was: Re: Using NSBundle]
  • Index(es):
    • Date
    • Thread