陈斌彬的技术博客

Stay foolish,stay hungry

Terminating App Due to Uncaught Exception 'NSGe...

OC中,当用forin对数组进行遍历时,是不能对数组进行增删操作的,否则,就会看到:

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

改正为正常的 for(int i = 0; i < size; i ++)即可