1,
for (int i = 0 ; i< tempArr.count; i++) {
MessageDetailInfo *info = [tempArr objectAtIndex:i];
for (int j = 0; j<self.dataArray.count; j++) {
MessageDetailInfo *messInfo = [self.dataArray objectAtIndex:j];
if (messInfo.idNumber == info.idNumber) {
continue;
}
[self.dataArray addObject:[tempArr objectAtIndex:i]];
}
}
2,
for (int i = 0 ; i< tempArr.count; i++) {
MessageDetailInfo *info = [tempArr objectAtIndex:i];
for (int j = 0; j<self.dataArray.count; j++) {
MessageDetailInfo *messInfo = [self.dataArray objectAtIndex:j];
if (messInfo.idNumber == info.idNumber) {
continue;
}
[self.dataArray addObject:[tempArr objectAtIndex:i]];
}
}
3,
for (int i = 0 ; i< tempArr.count; i++) {
MessageDetailInfo *info = [tempArr objectAtIndex:i];
for (int j = 0; j<self.dataArray.count; j++) {
MessageDetailInfo *messInfo = [self.dataArray objectAtIndex:j];
if (messInfo.idNumber != info.idNumber) {
[self.dataArray addObject:[tempArr objectAtIndex:i]];
}
}
}
for (int i = 0 ; i< tempArr.count; i++) {
MessageDetailInfo *info = [tempArr objectAtIndex:i];
for (int j = 0; j<self.dataArray.count; j++) {
if (![self.dataArray containsObject:info]) {
[self.dataArray addObject:[tempArr objectAtIndex:i]];
}
}
}