在xcode中寫init函數時一般都是如下寫法:
-(id) init { if(![super init]) { return nil; } //todo return self }
但是analyze分析器會提示instance variable used while 'self' is not set to the result of '[(super or self) init...]
只要做如下修改就沒有問題了。
-(id) init { self = [super init]; if(!self) { return nil; } //todo return self }
