1

我用这些数据创建了一个字典:

NSString *fileContentMap = [[NSString alloc] initWithContentsOfFile:MapPath];  

SBJsonParser *parserMap = [[SBJsonParser alloc] init];

NSDictionary *dataMap = (NSDictionary *) [parserMap objectWithString:fileContentMap error:nil];

NSArray *MaparrayLongitude = [dataMap objectForKey:@"longitude"];
NSArray *MaparrayLatitude = [dataMap objectForKey:@"latitude"];


NSDictionary* DictionaryMap = [NSDictionary dictionaryWithObjects:MaparrayLatitude forKeys:MaparrayLongitude];

..然后我用这段代码阅读它:

 NSArray *allKeys2 = [DictionaryMap allKeys];

    NSString *key2 = [allKeys2 objectAtIndex:i];
    NSObject *obj2 = [DictionaryMap objectForKey:key2];

...但是键没有排序,我希望它们按原始顺序排序。我怎样才能做到这一点??

4

0 回答 0