Avoiding “NSArray was mutated while being enumerated”

后端 未结 10 1776
傲寒
傲寒 2020-11-29 06:07

I have an NSMutableArray that stores mousejoints for a Box2d physics simulation. When using more than one finger to play I\'ll get exceptions stating

10条回答
  •  独厮守ぢ
    2020-11-29 06:09

    I have come across this error and in my case it was because of the multi-threaded situation. One thread was enumerating an array while another thread removed objects from the same array at the same time. Hope this helps someone.

提交回复
热议问题