gsdios / SDAutoLayout

One line of code to implement automatic layout. 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based on runtime.
MIT License
5.9k stars 1.28k forks source link

关于在xcode9 swift4 的一个一问题 #250

Open marsdan opened 6 years ago

marsdan commented 6 years ago

报错: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ZPSwiftDemo.EditDataTextTableViewCell 0x1061e1400> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key model.'

lx213 commented 6 years ago

今天找到解决办法,但我还没来改,之前是用snapkit添加底部约束来实现自适应行高了,原因应该是因为swift4下NSObject的setvalue机制做了修改,需要在类的声明前面加上@objcmembers,在被观察查的属性前面添加dynamic修饰,这样就不会报找不到key了,我再我其他用到了setvalue的类上测试过,列表因为之前修改了就还没来测试,不过应该可以解决

lushangshu commented 6 years ago

这个问题依然没有解决 不知道怎么在swif4 里面做出修改

beydeng commented 5 years ago

@lushangshu 不知道朋友,最后这个问题如何解决的啊

langyangyangzzZ commented 1 year ago

2023年也遇到这个问题了,难受