《遍历数组时,不要修改数组》2018-01-12

崩溃日志:*** Terminating appdue to uncaught exception 'NSGenericException', reason: '*** Collection<__NSArrayM: 0x61800024f7b0> was mutated while being enumerated.'

解决:(例如下)

NSMutableArray * tempArr = xxx;

    NSArray * array = [NSArray arrayWithArray: tempArr]; 

    for (NSDictionary * dic in array) {        

        if (OK){           

            [tempArr removeObject:dic];

        }      

    }

你可能感兴趣的:(《遍历数组时,不要修改数组》2018-01-12)