怎么根据key修改NSMutableArray中的值
2016-09-01
展开全部
因为array里那个dictionary是不可变的,用一个可变字典写回去,
NSDictionary *item =[array objectAtIndex:row];
NSMutableDictionary *mutableItem = [NSMutableDictionary dictionaryWithDictionary:item];
[mutableItem setObject:@“222” forKey:@"aa"];
[array setObject: mutableItem atIndexedSubscript:row]
NSDictionary *item =[array objectAtIndex:row];
NSMutableDictionary *mutableItem = [NSMutableDictionary dictionaryWithDictionary:item];
[mutableItem setObject:@“222” forKey:@"aa"];
[array setObject: mutableItem atIndexedSubscript:row]
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询