Value of my NSArray includes the duplicates.
I find the duplicates but now how can I find the no. they repeat?
3 Answers
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.
1 Comment
Aurum Aquila
Actually, I'll just +1 this answer and bookmark it in Chrome.
[[NSSet setWithArray:duplicateElements] allObjects];methods.