[newbie] takeValue:forKey memory management
[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.