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"]);

}

posted @ 2012-06-14 00:43  高笑228  阅读(182)  评论(0编辑  收藏  举报