Re: memory mgmt for NSMutableArray as ivar
Re: memory mgmt for NSMutableArray as ivar
- Subject: Re: memory mgmt for NSMutableArray as ivar
- From: Chris Suter <email@hidden>
- Date: Wed, 22 Aug 2007 15:23:01 +1000
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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