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: Chris Hanson <email@hidden>
- Date: Tue, 17 Apr 2007 16:06:56 -0700
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