Re: noobie mem management problem
Re: noobie mem management problem
- Subject: Re: noobie mem management problem
- From: mmalc Crawford <email@hidden>
- Date: Thu, 26 Feb 2009 08:04:30 -0800
On Feb 26, 2009, at 6:10 AM, Peter N Lewis wrote:
The next issue (and this is almost certainly where your problem is)
is that your @property is set to copy, so:
[self.currentStates addObject:@"hello"];
is equivalent:
[[self currentStates] addObject:@"hello"];
And [self currentStates] returns a copy of the NSMutableArray. And
so you create a copy, then you add the string, then it is
autoreleased.
No, this is wrong.
'copy' applies to the setter, not getter.
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_5_section_3.html#//apple_ref/doc/uid/TP30001163-CH17-SW2
>
mmalc
_______________________________________________
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