• 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
[newbie] takeValue:forKey memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[newbie] takeValue:forKey memory management


  • Subject: [newbie] takeValue:forKey memory management
  • From: Jay Prince <email@hidden>
  • Date: Fri, 16 Aug 2002 16:58:38 -0700

Hi there-

I have a situation where I need to set member values for a class, but I don't know whether the class has implemented an accessor (basically I have an id and a identifier to use with takeValue:forKey). Is takeValue:forKey memory safe?

In other words, if it finds there are no accessors for the given key, does it autorelease the old Value and retain the new one?

I'm assuming it does, and its safe to pass it an autoreleased object as value.... but that may not be a wise assumption.

What if there is an accessor in the class, does this mean there new object could be retained twice-- once by takeValue and once by the accessor?

Thanks for any advice.

Jay
_______________________________________________
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.

References: 
 >Creating a stand-alone NSToolbar controller (From: David Martin <email@hidden>)

  • Prev by Date: Re: File's Owner
  • Next by Date: adding pages to a generated pdf
  • Previous by thread: Re: Creating a stand-alone NSToolbar controller
  • Next by thread: Re: Creating a stand-alone NSToolbar controller
  • Index(es):
    • Date
    • Thread