I am trying to sort an NSDictionary
in ascending order. I am using this code:
NSDictionary *valDict = self.mGetDataDict[key][rowKey];
for (NSString
Try to use this one....
// changes.......
NSArray *valDict = [[self.mGetDataDict allValues] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
NSMutableDictionary *orderedDictionary=[[NSMutableDictionary alloc] init];
for (NSString *valor in valDict)
{
for (NSString *clave in [yourDictionary allKeys])
{
if ([valor isEqualToString:[valDict valueForKey:clave]])
{
[orderedDictionary setValue:valor forKey:clave];
}
}
}