Re: Objective-C 2.0 @property(readonly) memory leak question
Re: Objective-C 2.0 @property(readonly) memory leak question
- Subject: Re: Objective-C 2.0 @property(readonly) memory leak question
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 03 Feb 2009 07:56:58 -0800
On Feb 3, 2009, at 7:53 AM, Adam Venturella wrote:
Ah! so if I never call upon the accessor, it would never make a copy.
Since it made a copy(once called), it's retained, and thus would be my
responsibility for releasing it.
Thanks for the link! Didn't even think copy was the issue.
Sure. The docs are really quite good, just remember to dive deep on
the conceptual guides first as they contain information that is
universal to all APIs.
And, btw, for those reading along, a correct, non-atomic, accessor
that copies would look like:
- (NSArray *) fooArray
{
return [[myMutableFooArrayIVar copy] autorelease];
}
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden