// 将数组重复的对象去除,只保留一个
+ (NSArray *)arrayWithMemberIsOnly:(NSArray *)array
{
NSMutableArray *categoryArray = [NSMutableArray alloc] init];
for (unsigned i = 0; i < [array count]; i++) {
@autoreleasepool {
if ([categoryArray containsObject:[array objectAtIndex:i] == NO) {
[categoryArray addObject:[array objectAtIndex:i];
}
}
}
return categoryArray;
}
把 + 换成 -,不然self是调用不了的
时间: 2024-10-31 10:46:23