Re: Should objects returned by indirection be autoreleased
Re: Should objects returned by indirection be autoreleased
- Subject: Re: Should objects returned by indirection be autoreleased
- From: Jim Correia <email@hidden>
- Date: Fri, 12 May 2006 08:48:55 -0400
On May 12, 2006, at 8:42 AM, Jim Correia wrote:
On May 11, 2006, at 8:15 PM, Eric wrote:
For example, this NSFormatter method:
- (BOOL)getObjectValue:(id *)anObject forString:(NSString *)string
errorDescription:(NSString **)error
Should the two indirectly returned objects (anObject and error) be
autoreleased? In other word, if I get an object from any method
other than
alloc, etc., no matter how it's returned, it should be autoreleased,
correct?
If you -alloc, -copy, -mutableCopy, -new and object you must
release it.
And -retain.
That's what I get for summarizing the rules rather than pointing at
the canonical source.
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043-BEHDEDDB
Jim
_______________________________________________
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