IOS need to sort an array of dictionaries value based on key price

ios, iphone

Solution

 sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"price"
                                                 ascending:YES selector:@selector(localizedStandardCompare:)] ;

Please replace this one and try , hope its works .

Problem

'm facing problem to sort the values based on key using dictionary object. Actually what i am storing is, each dictionary object having different data type in that dictionary all the data type taking as a string how to convert this string type to specific data type and sort it price vise, my code and out put is bellow, Please help me on this one. ``` -(IBAction)PriceSort:(id)sender { NSSortDescriptor * sort = [[NSSortDescriptor alloc] initWithKey:@"Price" ascending:true] ; NSArray *sa = [symbolArray sortedArrayUsingDescriptors:[NSArray arrayWithObject:sort]]; NSLog(@"price=%@",sa); } ``` out put { ``` volume = 2496752; Yield = "10.49"; MarCap = 829; Price = "0.715"; Symbol = SAIPI; }, ```

Original source