对于loadView和viewDidLoad的解释

综上:

  • 如果当前的VC不使用Interface Builder,请覆盖这个方法,反之如果使用了,则一定不能覆盖这个方法(you must not overridethis method)。
  • loadView这个方法负责创建当前VC的根视图的视图层级(view hierachy),在这里给self.view赋值(non-nilvalue),并且不要调用[super loadView];(Your custom implementation of this method should not call super);
  • viewDidLoad用来做额外的初始化(additional initialization);

原文链接

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-01-25
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2021-12-01
  • 2022-12-23
  • 2021-08-07
  • 2021-09-06
相关资源
相似解决方案