• 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: Most efficient way to iterate through an NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Most efficient way to iterate through an NSArray


  • Subject: Re: Most efficient way to iterate through an NSArray
  • From: Guido Neitzer <email@hidden>
  • Date: Wed, 19 Mar 2008 13:07:45 -0600

On 19.03.2008, at 12:52, Galen Rhodes wrote:

The new way will fail too. It will throw a ConcurrentModificationException. If you think the array will change then best thing to do, if your working with NSArray, is to clone the array and then iterate over the clone like so:

	for(Object obj : myArray.immutableClone()) {
		/* Do Something With obj Here. */
	}

Sure. I was just wondering how the new style works.

cug

--
http://www.event-s.net

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Most efficient way to iterate through an NSArray (From: David Avendasora <email@hidden>)
 >Re: Most efficient way to iterate through an NSArray (From: Gaastra Dennis - WO Lists <email@hidden>)
 >Re: Most efficient way to iterate through an NSArray (From: Guido Neitzer <email@hidden>)

  • Prev by Date: Re: Most efficient way to iterate through an NSArray
  • Next by Date: Re: DST fixed for 08 in 5.4??
  • Previous by thread: Re: Most efficient way to iterate through an NSArray
  • Next by thread: Finding an empty to many relationship
  • Index(es):
    • Date
    • Thread