I am using Objective C on iOS 9.
I want to get Unique NSDictionaries
from NSArray
of NSDictionary
.
I have N
numbers of NSDictionaries
which look like bellow (for example):
staff Description Price
***** *********** *****
01 'some string' 9.99
05 'some string' 8.80
01 'some string' 7.45
01 'some string' 4.21
How to achieve my goal from these?
The unique parameter is staff
.
I want to get Unique NSArray for each, as:
{
@[
@[@{@"staff":01,@"description":@"some string",@"price":9.88},
@{@"staff":01,@"description":@"some string",@"price":7.45},
@{@"staff":01,@"description":@"some string",@"price":4.21}
],
@[@{@"staff":05,@"description":@"some string",@"price":8.80}
],
];
}
This question might look like a possible duplicate of this, but there is a difference, that I don't want sorted data in any manner. Second, I want array of those dictionaries which key->staff
is similar.