实战例子:过滤数组中相同的元素
文本复制:
//过滤相同的好友请求--LQ注释
-(NSMutableArray*)arrayWithOnly:(NSMutableArray*)arr{
NSMutableArray*array = [NSMutableArrayarray];
for (ApplyEntity *modelin arr) {
[array addObject:model.receiverUsername];
}
NSMutableArray*categoryArr = [NSMutableArrayarray];
for (inti =0; i
if ([arraycontainsObject:[arrayobjectAtIndex:i]]==NO) {
[categoryArraddObject:[arrobjectAtIndex:i]];
}
}
return categoryArr;
}
网友评论