instance variable access (via self) results in a null pointer dereference

会有一股神秘感。 提交于 2019-12-08 14:58:54

问题


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:


回答1:


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.



来源:https://stackoverflow.com/questions/10246945/instance-variable-access-via-self-results-in-a-null-pointer-dereference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!