reason: '[<__NSDictionaryI setValue:forUndefinedKey this class is not key value coding-compliant

reason: '[<__NSDictionaryI 0xa68ec40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key caption.'

在字典赋值的时候出现这个问题,因为setvalue:forkey是NSMutableDictionary的方法,在NSDictionary中没有这个方法,所以出现这个错误

解决办法

NSMutableDictionary *m = [[[self.form valueForKey:@"photos"] objectAtIndex:indexPath.row ] mutableCopy];

将NSDictionary转化为NSMutableDictionary

你可能感兴趣的:(reason: '[<__NSDictionaryI setValue:forUndefinedKey this class is not key value coding-compliant)