Cannot assign value nil for key

2019-01-16  本文已影响10人  叶舞清风

Cannot assign value nil for key "self.imageView".

今天打开工程调试界面时报错

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSDictionaryOfVariableBindings failed because either one of the values is nil, or there's something wrong with the way the macro is being invoked. Cannot assign value nil for key "self.imageView". Keys:(
"self.imageView",
"self.descLabel"
)'

屏幕快照 2019-01-16 上午11.03.49.png

解决方法:MASAttachKeys(self.imageView,self.descLabel)中的MASAttachKeys将内容设置为 assign
所以MASAttachKeys应放在控件创建之后

上一篇下一篇

猜你喜欢

热点阅读