Astoryboard.Instantiateviewcontrollerwithidentifier
("Myid") Returns Nil But Not Nil in Lldb

Storyboard returns nil need some quick advise how to instantiate

Use below code to instantiate your storyboard

self.storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];

null / nil in swift language

Regarding equivalents:

  • NULL has no equivalent in Swift.
  • nil is also called nil in Swift
  • Nil has no equivalent in Swift
  • [NSNull null] can be accessed in Swift as NSNull()

Note: These are my guesses based on reading and play. Corrections welcome.

But nil/NULL handling in Swift is very different from Objective C. It looks designed to enforce safety and care. Read up on optionals in the manual. Generally speaking a variable can't be NULL at all and when you need to represent the "absence of a value" you do so declaratively.



Related Topics



Leave a reply



Submit