[Solved] Sort a dictionary array when the key is given as the parameter

[ad_1]

Try this :

NSSortDescriptor * sortDescriptors = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; // change your key here
NSArray * arrSortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray * sortedArray = [yourArray sortedArrayUsingDescriptors:arrSortDescriptors];
NSLog(@"sortedArray %@",sortedArray);

0

[ad_2]

solved Sort a dictionary array when the key is given as the parameter