iOS-UIKit-View & Xib

  • initWithNibName 大多用于VC和Xib连起来 ,延迟加载,等vc显示出来的时候再初始化视图

  • loadNibNamed 大多是那种view和xib连起来 创建出来的时候所有视图已经初始化好了

when using loadNibNamed:owner:options:, the File's Owner should be NSObject, the main view should be your class type, and all outlets should be hooked up to the view, not the File's Owner

  • initWithCoder :initWithNibName 和 loadNibNamed 都会调用

  • awakeFromNib :xib文件加载的时候会触发

你可能感兴趣的:(iOS-UIKit-View & Xib)