Implicit conversion of 'int' to 'id' is disallowed with ARC

    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' to 'id' is disallowed with ARC)