Chris G.
Chris G.

Reputation: 25934

(lldb) po self.storyboard nil

How/when can a UIViewController return self.storyboard nil.

I am trying to instantiate a ViewController with:

self.storyboard!.instantiateViewControllerWithIdentifier


But self.storyboard is nil?
Note: the plist is set to the right storyboard.

Upvotes: 0

Views: 423

Answers (2)

nhgrif
nhgrif

Reputation: 62052

Per the Apple documentation, UIViewController's storyboard property represents the storyboard from which the view controller originated. It returns an optional UIStoryboard instance which is nil if the view controller was not instantiated from a storyboard.

Upvotes: 1

Chris G.
Chris G.

Reputation: 25934

Try this :

let localStoryboard = UIStoryboard(name: "Main", bundle: nil)

Upvotes: 0

Related Questions