• 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: Collection was mutated while being enumerated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Collection was mutated while being enumerated


  • Subject: Re: Collection was mutated while being enumerated
  • From: Milo Bird <email@hidden>
  • Date: Fri, 2 Nov 2007 10:25:40 +0000

There were a number of performance improvements in Obj-C 2.0
One of them was loop optimization.
In order for this optimization to work, you can't change (mutate) a collection while iterating through it with an enumerator.
I.E.: you can't add/delete items in an array or dictionary (change the count) while looping through it - that's what the message below is saying.

It's always been very dangerous to modify a collection while enumerating it. It's just the logging that's new in Leopard.
_______________________________________________


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


  • Prev by Date: Re: Choppy Core Animation
  • Next by Date: Re: Error (1000) creating CGSWindow
  • Previous by thread: Re: [Leopard] Debugging GC
  • Next by thread: objectsForXQuery: can return Foundation objects?
  • Index(es):
    • Date
    • Thread