Getting unique items from NSMutableArray
- by Gidogeek
Hi Guys,
I have a question about Objective-C today involving NSMutableArray. Coming from a .net/c# background I'm having some trouble working with these things.
Let's say I have an object called "Song"
My song has 3 properties:
Title
Artist
Genre
I have a NSMutableArray or NSArray wich holds all my Song objects.
How would I go about trying to 'query' my array to get a new array with only (Unique) Artists or Genre's.
Where as in .net you would write a simple LINQ query with a DISTINCT clause, how would one solve this in Objective-C ? I'm guessing with predicates but am struggling to find a solution.
Thanks in advance.