好岸园IT技术学习网 hopean.com IT新闻 js网页特效 it技术 二次开发

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

posted @ 2012-11-26 12:13  hopeanCom  阅读(1435)  评论(0)    收藏  举报