Make unique NSMutableArray or NSMutableSet

后端 未结 4 1914
挽巷
挽巷 2020-12-31 04:35

I\'m currently enumerating through NSMutableArray (or NSMutableSet) elements to find duplicates and remove them.

For example, if array/set

4条回答
  •  梦毁少年i
    2020-12-31 05:24

    Only this line of code will work fine .

    NSSet *mySet = [NSSet setWithArray:myArray];
    

    now mySet will have unique elements.

提交回复
热议问题