Re: memory mgmt for NSMutableArray as ivar
Re: memory mgmt for NSMutableArray as ivar
- Subject: Re: memory mgmt for NSMutableArray as ivar
- From: Daniel Child <email@hidden>
- Date: Wed, 22 Aug 2007 10:53:01 -0400
I skimmed through Kochan's chapter on copying and he has a paragraph
on the difference. Just to clarify, you use mutableCopy to ensure
that the list is a mutable array, correct?
On Aug 22, 2007, at 1:23 AM, Chris Suter wrote:
On 22/08/2007, at 2:42 PM, Andrew Merenbach wrote:
Next, your -setList: method needs a conditional test (this is one
way of doing things, and--based upon a query that I made to this
list before--the fastest way):
- (void)setList:(NSArray *)anArray {
if (anArray != list) {
[list release];
list = [anArray copy];
}
}
Minor point: it should be
list = [anArray mutableCopy]
- Chris
_______________________________________________
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