• 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: Tony Becker <email@hidden>
  • Date: Mon, 29 Oct 2007 20:32:26 -0400

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.


On Oct 29, 2007, at 5:02 PM, Philip Dow wrote:

Since installing Leopard I'm seeing the following appear appear in the console: "*** Collection <NSCFDictionary: 0x5e2e540> was mutated while being enumerated."

I imagine this was something happening in the code before Leopard but Leopard started logging it. Is there by any chance a breakpoint I can set to catch where this is occurring? Would be handy.

-Phil
_______________________________________________

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

_______________________________________________

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: 
 >Collection was mutated while being enumerated (From: Philip Dow <email@hidden>)

  • Prev by Date: Re: Figuring out Interface Builder 3.0
  • Next by Date: Re: [Leopard] Debugging GC
  • Previous by thread: Re: Collection was mutated while being enumerated
  • Next by thread: Grabbing what's behind a window
  • Index(es):
    • Date
    • Thread