iOS开发 NSDictionary的简单遍历

-(void)dictionaryPrint

{

    NSArray *keys = [dic allKeys];

    id key,value;

    

    for (int i = 0; i < [keys count]; i++) {

        key = [keys objectAtIndex:i];

        value = [dic objectForKey:key];

        //NSLog(@"Key:%@ -- %@",key,value);

        

        for (int j = 0; j<[value count]; j++) {

            NSString *str = [value objectAtIndex:j];

            NSLog(@"%@---%@",key,str);

        }

    }

}

更多阅读请访问http://www.hopean.com

原文地址:https://www.cnblogs.com/hopeanCom/p/2789561.html