简体   繁体   中英

(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.

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.

尝试这个 :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM