• 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
NSImageView setImage & when to release NSImage...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImageView setImage & when to release NSImage...


  • Subject: NSImageView setImage & when to release NSImage...
  • From: "Brad Peterson" <email@hidden>
  • Date: Fri, 24 Oct 2003 11:10:56 +0000

Hi all,

Maybe this is explained somewhere and it's just too late for me to spot it, but here goes...

If my goal is to display an image stored on disk, I might do something like...

myImage = [[NSImage alloc] initByReferencingFile:filename];
[myImageView setImage: myImage];

Yes?

So... in this scenario, when does myImage get released? Am I responsible for releasing it? I would think so, but I'm unclear on whether NSImageView "needs" the NSImage once you've called setImage... or, perhaps it's smart enough to release it when it's done?

Can anyone clarify what is probably a very basic thing I've somehow overlooked?

Thanks,

B

_________________________________________________________________
See when your friends are online with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: NSImageView setImage & when to release NSImage...
      • From: Chris Hanson <email@hidden>
    • Re: NSImageView setImage & when to release NSImage...
      • From: "Alastair J.Houghton" <email@hidden>
    • Re: NSImageView setImage & when to release NSImage...
      • From: Ambroise Confetti <email@hidden>
  • Prev by Date: Re: NewCommer -win32 to cocoa
  • Next by Date: addCursorRect overrides action/connection?
  • Previous by thread: Re: Panther
  • Next by thread: Re: NSImageView setImage & when to release NSImage...
  • Index(es):
    • Date
    • Thread