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

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"
)'

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

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

猜你喜欢

转载自blog.csdn.net/weixin_34414196/article/details/86882761