init方法的固定格式
- (id)init {
self = [super init];
if (self) {
// Initialize self.
}
return self;
}
注意
要先实现父类的init方法,再实现自己的
- (id)init {
self = [super init];
if (self) {
// Initialize self.
}
return self;
}
注意
要先实现父类的init方法,再实现自己的