Re: safe and efficient way tp duplicate NSMutable array
Re: safe and efficient way tp duplicate NSMutable array
- Subject: Re: safe and efficient way tp duplicate NSMutable array
- From: "Jay" <email@hidden>
- Date: Tue, 17 Apr 2007 20:52:32 +0800
Thanks for your reply, but what I intended to do is to get the data
duplicated as well, so in that case, I have to do everything manually? I
need to do this just because I need to keep the original data and modify the
new copy of it.
Thanks.
Jay
----- Original Message -----
From: "Chris Hanson" <email@hidden>
To: "Jay" <email@hidden>
Cc: <email@hidden>
Sent: Wednesday, April 18, 2007 7:06 AM
Subject: Re: safe and efficient way tp duplicate NSMutable array
On Apr 17, 2007, at 3:42 AM, Jay wrote:
I'm using NSMutabArray to store some instance objects of customer class,
I find it quite complex when try to create another identical
MutableArray object instance and it is easy to get into some troubles
while duplicating the array, will there be some safe ways to do it?
Thanks a lot. This may be some kind of simple questions but....
What's wrong with using -copy or -mutableCopy to copy the array
(depending on whether you want to be able to change the copy, of course)?
What kind of "troubles" are you getting into when copying it?
Just remember that all copying in Cocoa is shallow. You're copying the
array itself, not the data within it.
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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