Monday, 26 August 2013

Get list of Values for an NSArray of NSDictionary

Get list of Values for an NSArray of NSDictionary

I've got the following NSArray :
NSArray myArray = @[@{@300:@"5 min"},
@{@900:@"15 min"},
@{@1800:@"30 min"},
@{@3600:@"1 hour"}];
I want the list of value of my dictionaries :
@[@"5 min",@"15 min",@"30 min",@"1 hour"]
And the list of key of my dictionaries :
@[@300, @900, @1800, @3600]
What is the best way to do that ? I was thinking about predicate, but I
don't know how to use it ?

No comments:

Post a Comment