Skip to content

Instantly share code, notes, and snippets.

View sergiosvieira's full-sized avatar

Sérgio Vieira sergiosvieira

  • Fortaleza
View GitHub Profile
@sergiosvieira
sergiosvieira / snippet.m
Created June 7, 2013 15:51
sorting array of keys of nsdictionary based on value of nsdictionary
NSDictionary *original = @{
@"Campo de Teste" : @{@"order" : @"1"},
@"Alguma coisa" : @{@"order" : @"4"},
@"outro teste" : @{@"order" : @"2"},
@"fala cara" : @{@"order" : @"3"},
};
NSArray *sortedArray;
sortedArray = [original.allKeys sortedArrayUsingComparator:^NSComparisonResult(NSString *a, NSString *b) {