iOS 模型数组去重
Tip:不要对一个可变数组遍历的同时增删改查!!!!
NSMutableArray *temp = [NSMutableArray arrayWithArray:tempArr.copy];
for (NSInteger i = 0; i < temp.count; i++) {
for (NSInteger j = i+1;j < temp.count; j++) {
ItemModel *tempModel = temp[i];
ItemModel *model = temp[j];
if ([tempModel compareWithAnotherModel:model]) {
[tempArr removeObject:model];
}
}
}