实例变量访问(通过self)导致空指针取消引用 [英] instance variable access (via self) results in a null pointer dereference

查看:257
本文介绍了实例变量访问(通过self)导致空指针取消引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用上运行分析会导致主题出现逻辑错误。我真的不知道那是什么意思。下面是错误的屏幕:

Running an analysis on my app results in the logical error in the subject. I don't really know what that means. Below is a screen of the error:

推荐答案

显示的路径是 super 返回 nil 。如果发生这种情况,则继续执行该方法;否则,将继续执行该方法。隐式的自尊是因为 isShowingLandscapeView 是一个实例变量。您需要将所有初始化都放在 if(self)块中,以免发生这种情况。

The path it's showing you is super returning nil. If this happens, you continue to execute the method; the implicit self deference is because isShowingLandscapeView is an instance variable. You need to put all your initialisation inside the if (self) block to avoid this.

这篇关于实例变量访问(通过self)导致空指针取消引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆