How to count duplicates values in NSArray?

后端 未结 3 1225
情书的邮戳
情书的邮戳 2021-02-02 03:08

Value of my NSArray includes the duplicates. I find the duplicates but now how can I find the no. they repeat?

3条回答
  •  清酒与你
    2021-02-02 04:04

    You can use NSCountedSet for this. Add all your objects to a counted set, then use the countForObject: method to find out how often each object appears.

提交回复
热议问题