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

BUG记录--

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

出现原因:当程序出现这个提示的时候,是因为你一边遍历数组,又同时修改这个数组里面的内容,导致崩溃

解决办法:再定义一个一模一样的新数组,遍历新数组,再对原数组操作

你可能感兴趣的:(Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0xb550c30> was mutated while being enumerated.')