• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: safe and efficient way tp duplicate NSMutable array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: safe and efficient way tp duplicate NSMutable array
      • From: "Shawn Erickson" <email@hidden>
    • Re: safe and efficient way tp duplicate NSMutable array
      • From: "stephen joseph butler" <email@hidden>
    • Re: safe and efficient way tp duplicate NSMutable array
      • From: Murat Konar <email@hidden>
References: 
 >safe and efficient way tp duplicate NSMutable array (From: "Jay" <email@hidden>)
 >Re: safe and efficient way tp duplicate NSMutable array (From: Chris Hanson <email@hidden>)

  • Prev by Date: Smaller Button in NSTextFieldCell
  • Next by Date: Re: silly question about build/release
  • Previous by thread: Re: safe and efficient way tp duplicate NSMutable array
  • Next by thread: Re: safe and efficient way tp duplicate NSMutable array
  • Index(es):
    • Date
    • Thread