IOS 删除数组中重复的元素

NSArray *array = [[NSArray alloc] initWithObjects:@"12",@"2",@"3",@"2",@"1",@"5", nil];

NSSet *uniqueElements = [ NSSet setWithArray :array ];

for (id element in uniqueElements )

{ NSLog(@"%@",element); }

}

 

posted @ 2015-02-07 10:43  NSFuck  阅读(1361)  评论(0编辑  收藏  举报