标签:
swift引入后,为了使oc和swift更相近,对oc的初始化方法也进行了修正,具体说明,见下面的链接,这个waring的最简单的修正方法是,到相应类的头文件中,去掉在自定义初始化方法后面的 NS_DESIGNATED_INITIALIZER宏。这样系统就不会认为我们定义了designated initializer,仅仅定义了一个convience initializer,就不会报错了!
重要的解释如下:
The designated initializer guarantees the object is fully initialised by sending an initialization message to the superclass. The implementation detail becomes important to a user of the class when they subclass it. The rules for designated initializers in detail:
详细解释:
ios 修正waring:Method override for the designated initializer of the superclass '-init' not found
标签:
原文地址:http://www.cnblogs.com/breezemist/p/4829687.html