Analyze问题解决

最近公司的项目接近尾声了,用Analyze来检测一下,结果发现了些问题,本身顺便记录一下。

一、Value stored to '' during its initialization is never read这个值并无被使用,注释或者删除便可;还有一种状况就是,初始化了两次
bash

二、Passed-by-value struct argument contains uninitialized data (e.g., field: '')项目中的值没有及时的初始化,初始化使用后便可ui

三、The 'viewWillAppear:' instance method in UIViewController subclass '' is missing a [super viewWillAppear:] call
spa


没有调用super方法code

四、Returning 'self' while it is not set to the result of '[(super or self) init...]'
cdn


修改为以下blog

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self layoutUI];
    }
    return self;
}
复制代码
相关文章
相关标签/搜索