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

来源:互联网 发布:人脸识别算法代码csdn 编辑:程序博客网 时间:2024/05/29 03:18
    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]否者会报标题上得错误


原创粉丝点击