How to get unique values based on dictionary key, which is an element of an array in objective C ?
for example:
i am having an array of an Items
aryItem
aryItem[0] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
aryItem[1] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
...........
...........
aryItem[n] = Dictionary{
ItemCategory
ItemName
ItemPrice
}
Now i want to get only unique ItemCategory , not duplicates. If i can write [[aryItem objectatIndex:i] valueForKey:ItemCategory] i get all categories, same category also included in this. I need only unique categories. I have an option searching whole array and then get unique Itemcategory objects, but i am looking for any short way to accomplish the same thing.
Thanks.