I hope that there is somebody outside, who can help me with this:
I have an unsorted array of dictionaries which have a STRING field (Km) inside that contains numbers (e.g. 12,0; 1,2; 6,4). If I do a normal SORT, the array will be sorted that way: 1,2 12,0 6,4
But it should sorted that way: 1,2 6,4 12,0
Does anybody has an example code how to do this? I'm looking forward to get an answer.
Thanks and regards Marco
Edit my code for further understanding:
NSMutableArray *tempArray = [[NSArray alloc] init];
self.Digger = tempArray;
[tempArray release];
self.Digger = [self.Diggers objectForKey:@"Rows"];
NSSortDescriptor * sort = [[[NSSortDescriptor alloc] initWithKey:@"KM" ascending:true] autorelease]; [self.Digger sortUsingDescriptors:[NSArray arrayWithObject:sort]];
self.Digger = sort;
But this gives me the follwoing error in the log: -[NSSortDescriptor count]: unrecognized selector sent to instance