for (QHBossCurrencyListInfoModel *model in dataArray) { if ([model.currency isEqualToString:@"BTC"]) { [dataArray removeObject:model]; } }
致使會奔潰,由於改變了遍歷的數組數組
正確的寫法以下code
NSMutableArray *list = [NSMutableArray arrayWithArray:dataArray]; for (QHBossCurrencyListInfoModel *model in list) { if ([model.currency isEqualToString:@"BTC"]) { [dataArray removeObject:model]; } }