Collection <__NSArrayM: 0x7fa1f2711910> was mutated while being enumerated

后端 未结 5 1283
轮回少年
轮回少年 2020-12-30 14:05

There are number of questions with similar title but none them of helped me.

but i can relate solution of this 'NSGenericException', reason: Collection <

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-30 14:27

    You can't modify the array while looping through it with the for...in... control statement.

    Try:

        NSArray *compareArray = [updatedLocalityArray copy];
        for (NSString *test in compareArray)
        // ...
    

提交回复
热议问题