繁体   English   中英

指定的初始化程序缺少对超类的指定初始化程序的超级调用

[英]designated initializer missing a super call to a designated initializer of the super class

我在像1.这样的Pod中收到2条警告。指定的初始化程序缺少对超类的指定初始化程序的超级调用。 2.指定的初始化程序仅应在super上调用指定的初始化器。

- (instancetype)initWithFrame:(CGRect)ignoredFrame { return [self init]; }

<code>在此处输入图片描述</ code>

尝试下面的代码,这将删除警告

- (instancetype)initWithFrame:(CGRect)ignoreframe {
    self = [super initWithFrame:ignoreframe];
    if (self) {
        // load view frame XIB
    }
    return self;
}

要了解更多详细信息,请看这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM