objective-c – 我应该调用[super awakeFromNib]吗?

objective-c – 我应该调用[super awakeFromNib]吗?,第1张

概述如果我实现我自己的awakeFromNib版本,应该在我的方法结束时调用[super awakeFromNib]? awakeFromNib for UIKit (iOS): You must call the super implementation of awakeFromNib to give parent classes the opportunity to perform any add 如果我实现我自己的awakeFromNib版本,应该在我的方法结束时调用[super awakeFromNib]?解决方法 awakeFromNib for UIKit (iOS): @H_404_11@

@H_404_11@

@H_404_11@You must call the super implementation of awakeFromNib to give parent classes the opportunity to perform any additional initialization they require. Although the default implementation of this method does nothing,many UIKit classes provIDe non-empty implementations. You may call the super implementation at any point during your own awakeFromNib method.

@H_404_11@awakeFromNib for AppKit (Mac):

@H_404_11@(不再是真的,如果使用OS X 10.6或更高版本)

@H_404_11@

@H_404_11@You should call the super implementation of awakeFromNib only if you kNow for certain that your superclass provIDes an implementation. Because the Application Kit does not provIDe a default implementation of the awakeFromNib method,calling super results in an exception if the parent class does not implement it. Classes whose immediate parent class is NSObject or NSVIEw do not need to call the super implementation. For any other classes,you can use the instancesRespondToSelector: class method of NSObject to determine if the parent class responds to awakeFromNib and call the method if it does.

总结

以上是内存溢出为你收集整理的objective-c – 我应该调用[super awakeFromNib]吗?全部内容,希望文章能够帮你解决objective-c – 我应该调用[super awakeFromNib]吗?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1044593.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-24
下一篇2022-05-24

发表评论

登录后才能评论

评论列表(0条)

    保存