Re: Mutating method sent to immutable object
Re: Mutating method sent to immutable object
- Subject: Re: Mutating method sent to immutable object
- From: Scott Stevenson <email@hidden>
- Date: Sun, 10 Oct 2004 18:51:29 -0700
On Oct 10, 2004, at 6:36 PM, Bruce Truax wrote:
- (void)setExtraDataArray:(NSMutableArray *)newExtraDataArray {
if (extraDataArray != newExtraDataArray) {
[extraDataArray release];
extraDataArray = [newExtraDataArray copy];
}
}
And the array is initialized using:
[self setExtraDataArray:[NSMutableArray arrayWithCapacity:20]];
The problem is that -copy returns an immutable instance.
- Scott
--
http://treehouseideas.com/
http://theobroma.treehouseideas.com/ [blog]
_______________________________________________
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