美文网首页
Implicit conversion of 'int&

Implicit conversion of 'int&

作者: 蛐蛐_ | 来源:发表于2016-01-27 19:05 被阅读4147次
        NSMutableDictionary *dic = [typeArray objectAtIndex:1];
    //    NSString *typeName = [dic objectForKey:@"type"];
        NSMutableDictionary *infoDic = [dic objectForKey:@"dic"];
        //---------------------------------------------------出错----------------------------------------------------------------------
        NSLog(@"当前cell的InfoDic==%@",infoDic);
        NSMutableArray *allItem = [[NSMutableArray alloc] init];
        for (int i=0; i<[infoDic count]; i++) {
            NSDictionary *contentOfDic = [infoDic objectForKey:[NSNumber numberWithInt:i]];
            NSString *name = [contentOfDic objectForKey:@"sender"];
            [allItem addObject:name];
        }
    

    在NSMutableDictionary中获取key值为int类型的value必须要进行NSNumber转换[NSNumber numberWithInt:i] 否者会报标题上得错误

    相关文章

      网友评论

          本文标题:Implicit conversion of 'int&

          本文链接:https://www.haomeiwen.com/subject/rerbhttx.html