1

I've been bumping my head against the good old,

***Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x14d5e120> was mutated while being enumerated.

I've had to contend with this a couple of times before and usually it's fairly easy to identify where the offending code is. Only in this current case, I've checked everywhere in my code and can't find which array it is talking about.

So my question is is there any tool or debugger command I can use to help me pinpoint where in my code this thing is blowing up? I see the address of the array, but I don't know how to resolve this into a location in the code, if that's even possible at all.

Amar
  • 13,202
  • 7
  • 53
  • 71
mprivat
  • 21,582
  • 4
  • 54
  • 64
  • are you sure you are not having any `for(.. in ..)` in your program? If there is any such it must be updating something(that something is getting converted to NSArray behind the scence. – Anoop Vaidya Nov 21 '13 at 07:37
  • Check [this Q&A](http://stackoverflow.com/a/14767076/1407017) for _How to add exception breakpoint in Xcode?_. That should be able to give you the stack trace when the error occurs. Traverse it to the point of origin in your code. – Amar Nov 21 '13 at 07:41

0 Answers0