美文网首页
for循环报错 (was mutated while being

for循环报错 (was mutated while being

作者: 快闪开 | 来源:发表于2019-01-11 15:44 被阅读0次

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

    for (UseModel *m in weakSelf.clearItemArray) {

                if(m.parentID==model.parentID) {

                    [weakSelf.clearItemArrayremoveObject:m];

                    break;

                }

            }

    添加break,使其跳出循环。

    相关文章

      网友评论

          本文标题:for循环报错 (was mutated while being

          本文链接:https://www.haomeiwen.com/subject/zrmxdqtx.html