#pragma mark - 去除重复对象

pragma mark - 去除重复对象

  • (NSArray )arrayWithMemberIsOnly:(NSArray )array
    {
    NSMutableArray *categoryArray =[[NSMutableArray alloc] init];
    for (unsigned i = 0; i < [array count]; i++)
    {
    if ([categoryArray containsObject:[array objectAtIndex:i]] == NO) {
    [categoryArray addObject:[array objectAtIndex:i]];
    }
    }
    return categoryArray;
    }

你可能感兴趣的:(去除重复对象)