Search code examples
macoscocoaswiftnsviewcontroller

Swift IBOutlets are nil in awakeFromNib (xcode 6.1.1 osx 10.10.1)


I have a NSViewController (I'm using a storyboard) with one iboutlet connected to a NSOutlineView (yes, I have made absolutely shure that it really is connected), but when I try to reference it in awakeFromNib, the outlet is still nil although they should be guaranteed to be connected in awakeFromNib. Any ideas or solutions?


Solution

  • The Apple documentation says that the lifecycle of a NSViewController starts with viewDidLoad, so you should do your stuff there. enter image description here