• 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: NSArray to NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray to NSMutableArray


  • Subject: Re: NSArray to NSMutableArray
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 28 Nov 2008 18:31:00 -0800


On 28 Nov, 2008, at 6:29 PM, Pierce Freeman wrote:

I am wondering the correct/recommended technique to make a NSMutableArray
out of a NSArray.

On 2008 Nov, 28, at 17:30, Dave DeLong wrote:

How about -mutableCopy?

which gives you a retained object, and then there is +[NSMutableArray arrayWithArray:], which gives you a temporary object.


I see online that there are ways to do this, but am not
sure what is the best way.

So I use either, depending on whether I want retained or temporary. I suspect that it probably doesn't make it damned bit of difference because all this "mutable" and "copy" fluff gets optimized away under the hood anyhow.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >NSArray to NSMutableArray (From: Pierce Freeman <email@hidden>)
 >Re: NSArray to NSMutableArray (From: Dave DeLong <email@hidden>)

  • Prev by Date: Simple Core Animation Problem
  • Next by Date: Re: NSMutableDictionary Leak
  • Previous by thread: Re: NSArray to NSMutableArray
  • Next by thread: Re: NSArray to NSMutableArray
  • Index(es):
    • Date
    • Thread