美文网首页
Cannot assign value nil for key

Cannot assign value nil for key

作者: 叶舞清风 | 来源:发表于2019-01-16 11:09 被阅读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应放在控件创建之后

相关文章

网友评论

      本文标题:Cannot assign value nil for key

      本文链接:https://www.haomeiwen.com/subject/sygpdqtx.html