I am using storyboard instantiateViewControllerWithIdentifier:
and I'm noticing that all the IBOutlets
I have wired up are still nil. However, the IBActions
I have wired up work. The view and controller are linked (i.e controller.view is not nil), and if I show the view it displays what I am expecting.
What am I missing?
Here's my setup:
- I've got a View Controller defined in my storyboard. I have given it an identifier which is the same identifier I use when invoking
instantiateViewControllerWithIdentifier:
- I've set up the view's owner by clicking on the View Controller (just under First Responder) and under the Identity Inspector set the Custom Class to be the same name as the class I want to wire the view to.
- Then I open up Assistant editor, and control dragged the UI elements to create the
IBOutlets
and IBActions
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…