Could anyone possibly help me here, why I am getting NSFastEnumerationMutationHandler
crash all of a sudden in my code. I am all but blank why this crash poped up all of a sudden and how to squash this one.
Thanks.
Crash Error: **** Terminating app due to uncaught exception 'NSGenericException', reason: '* **Collection <__NSArrayM: 0x610000859410> was mutated while being enumerated.'*
You must be trying to change an array while you using fast enumeration.
Example
for ( id anObject in anArray ) {
if ( /* anObject satisfies some condition */ ) {
[anArray removeObject:anObject];
}
}
That shouldn't be done. Use a different array or probably filteredArrayUsingPredicate:
method to filter. Remedy, however, depends on what you're trying to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With