【发布时间】:2017-09-01 06:50:48
【问题描述】:
我在 pod 中收到 2 个警告,例如 1. 指定初始化程序缺少对超类的指定初始化程序的超级调用。 2. 指定初始化器应该只在super上调用指定初始化器。
- (instancetype)initWithFrame:(CGRect)ignoredFrame {
return [self init];
}
【问题讨论】:
标签: ios objective-c xcode objective-c-2.0
我在 pod 中收到 2 个警告,例如 1. 指定初始化程序缺少对超类的指定初始化程序的超级调用。 2. 指定初始化器应该只在super上调用指定初始化器。
- (instancetype)initWithFrame:(CGRect)ignoredFrame {
return [self init];
}
【问题讨论】:
标签: ios objective-c xcode objective-c-2.0
试试下面的代码,这将消除警告
- (instancetype)initWithFrame:(CGRect)ignoreframe {
self = [super initWithFrame:ignoreframe];
if (self) {
// load view frame XIB
}
return self;
}
想了解更多详情,请关注here
【讨论】: