• 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: NSImage setName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage setName


  • Subject: Re: NSImage setName
  • From: Paolo Costabel <email@hidden>
  • Date: Mon, 22 Nov 2004 18:29:36 -0800

Colin O'Connor wrote:
I'm creating an image and then setting the name of the image, but it seems
to not be working. Here is the code I'm using:

NSImage *image = [[NSImage alloc] initWithContentsOfFile:PATH_TO_IMAGE];
[image setName:@"Shadowfist_back"];
NSLog(@"Name: %@",[image name]);

This NSLog prints "Name: (null)". The image shows up in my window when I add
it to an NSImageView.

What am I doing wrong here?

Thanks,
Colin

 _______________________________________________
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

  
Try testing the return value of  image setName:
The docs say that if there is already an image with that name, setName returns NO and does nothing.

--
signature
Get Firefox!
 _______________________________________________
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: 
 >NSImage setName (From: "Colin O'Connor" <email@hidden>)

  • Prev by Date: NSImage setName
  • Next by Date: Re: [SOLVED] Newbie, regarding retain count and program flow
  • Previous by thread: NSImage setName
  • Next by thread: Re: [SOLVED] Newbie, regarding retain count and program flow
  • Index(es):
    • Date
    • Thread