iOS开发 NSDictionary的简单遍历

来源:互联网 发布:热血三国单机版数据库 编辑:程序博客网 时间:2024/05/22 09:50

-(void)dictionaryPrint

{

    NSArray *keys = [dic allKeys];

    id key,value;

    

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

        key = [keys objectAtIndex:i];

        value = [dicobjectForKey:key];

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

        

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

            NSString *str = [value objectAtIndex:j];

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

        }

    }

}

原创粉丝点击