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

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


  • Subject: Re: or Using NSImage... [was: Re: Using NSBundle]
  • From: Ryan Britton <email@hidden>
  • Date: Sat, 19 Nov 2005 09:08:44 -0800

Since that image is contained in your package, you could also use something like this instead:

NSImage *image = [NSImage imageNamed:@"oxford-physics-apple"];


On Nov 19, 2005, at 8:54 AM, Heinrich Giesen wrote:


On 19.11.2005, at 16:27, Graham J Lee wrote:

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


Your initialization of "theImage" looks very strange. If "theImage" is an object of NSImage (how was it created?) it should read:

NSImage *theImage = [[NSImage alloc] initWithContentsOfFile:....];

	HG

--
Heinrich Giesen
email@hidden


_______________________________________________ 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

_______________________________________________ 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
References: 
 >Re: or Using NSImage... [was: Re: Using NSBundle] (From: Heinrich Giesen <email@hidden>)

  • Prev by Date: XCoders in Portland, OR?
  • Next by Date: What NSEvent contains text from Ink input?
  • Previous by thread: Re: or Using NSImage... [was: Re: Using NSBundle]
  • Next by thread: Re: or Using NSImage... [was: Re: Using NSBundle]
  • Index(es):
    • Date
    • Thread