Collection <NSCFSet: 0x1b0b30> was mutated while being enumerated. How to determine which set?
Posted
by jamone
on Stack Overflow
See other posts from Stack Overflow
or by jamone
Published on 2010-05-02T16:39:50Z
Indexed on
2010/05/02
16:48 UTC
Read the original article
Hit count: 524
I'm doing a bunch of core data inserts and after 20k or so inserts with saves every 1-2k I get this error:
Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <NSCFSet: 0x1b0b30> was mutated while being enumerated.'
I'm trying to figure out which NSSet is causing this. I've done a search and the only NSSets in my code are the autogenerated ones that handle the Core Data relationships.
I'm using NSXMLParser and for each element found creating a new entity (if a matching one doesn't already exist).
So I will create a state entity and then populate all the city entities and then do a save. This means that a state's NSSet *cities is getting added to but I don't see why you can't do that.
© Stack Overflow or respective owner