awakeFromNib, outlets and storyboards: is the documentation wrong?

前端 未结 2 879
感情败类
感情败类 2020-12-16 10:58

According to the NSObject UIKit Additions Reference, outlet variables should be set by the time awakeFromNib is called (emphasis all mine):

2条回答
  •  时光取名叫无心
    2020-12-16 11:42

    View controllers wait until their view is accessed to actually create their view. Since the button is in the view controller's view, it won't be instantiated yet.

提交回复
热议问题