Dictionary convert NSArray

 NSBundle *bundle = [NSBundle mainBundle];
    NSURL *plistURL = [bundle URLForResource:@"provinceCities" withExtension:@"plist"];
    NSLog(@"%@", plistURL);
    
    self.dictionary = [NSDictionary dictionaryWithContentsOfURL:plistURL];
   
    NSArray *components = [dictionary allKeys];
    NSArray *sorted = [components sortedArrayUsingSelector:@selector(compare:)];
   

 

遍历字典

for (NSString* key in dictionary)

{

nslog(@"%@,%@",key,[dictionary ObjectiveForKey:@"key"]);

}

原文地址:https://www.cnblogs.com/gaoxiao228/p/2548700.html