• 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: 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


  • Follow-Ups:
    • Re: safe and efficient way tp duplicate NSMutable array
      • From: "Jay" <email@hidden>
References: 
 >safe and efficient way tp duplicate NSMutable array (From: "Jay" <email@hidden>)

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