I am getting below error that causing crash.
Terminating app due to uncaught exception NSGenericException reason Collection CALayerArray was mutated while being enumerated.
Any help would be highly appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“mutated while being enumerated” – this happens when, for instance, you enumerate through the contents of an array, and then inside the enumeration loop, you remove or add an object to the array.
Usually, if you want to modify an array, but you need to find which member to modify, you’d either make a copy of the array and enumerate that, and then do your mod,
or
make a reference to the object you want to delete, and do the delete outside of the loop. Like so: