setValue: forKey是NSMutableDictionary的一个扩展方法,当传入的value为nil时为调用removeObjectForKey:方法,对于NSDictionary来说没有removeObjectForKey:
方法,所以会报错 setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key xxx
setValue: forKey是NSMutableDictionary的一个扩展方法,当传入的value为nil时为调用removeObjectForKey:方法,对于NSDictionary来说没有removeObjectForKey:
方法,所以会报错 setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key xxx
本文标题:NSDictionary setValue: forKey:的坑
本文链接:https://www.haomeiwen.com/subject/tfxesxtx.html
网友评论