warning:Instance variable used while 'self' is not set to the result of '[(super or self) init…]'

来源:互联网 发布:分布式数据库的特点 编辑:程序博客网 时间:2024/05/20 06:25

问题

这种warning在Build的时候不用出现的,但用Xcode的静态分析工具 "Analyze",会提示:





修改如下:



原因:

在init有关的初始化方法中,必须先使用 [super init]来获取self,然后进一步使用
0 0
原创粉丝点击