how to remove duplicate value in NSMutableArray

前端 未结 6 1350
离开以前
离开以前 2021-01-24 22:32

i\'m scanning wifi info using NSMutableArray, but there are few duplicate values appear, so i try to use following code but still getting the duplicate values,

         


        
6条回答
  •  佛祖请我去吃肉
    2021-01-24 23:04

    This is another way:

    - (NSArray *)removeDuplicatesFrom:(NSArray *)array {
        NSSet *set = [NSSet setWithArray:array];
        return [set allObjects];
    }
    

提交回复
热议问题