问题:运行程序崩溃,报错:“Thread 1: [<*> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key **.”,截图如下:
原因:在kvc映射中,映射的字段名和个数不一致导致的。
解决方案:复写“func setValue(_ value: Any?, forUndefinedKey key: String)”方法。
问题:运行程序崩溃,报错:“Thread 1: [<*> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key **.”,截图如下:
原因:在kvc映射中,映射的字段名和个数不一致导致的。
解决方案:复写“func setValue(_ value: Any?, forUndefinedKey key: String)”方法。