title: How to fix error: memory read failed for 0x0
body: <p>I have clicked login button and the message throw in notification center and a country picker opened and when I click on button in country picker log in view Controller must be opened but it throws an error: </p>
  
  <blockquote>
    <p>memory read failed for 0x0 ........</p>
  </blockquote>
  
  <p>this error comes in between obtaining controller object and present.
  what should I do now??</p>
  
  <p>I am using Xcode 10.1 and Swift 4</p>
  
  <pre><code>@objc func showSpinningWheel(_ notification: NSNotification) {
      if whichbuttonclick == true
      {
  
          let vc = self.storyboard?.instantiateViewController(withIdentifier: "LoginViewController") as! LoginViewController
  
          self.present(vc, animated: true, completion: nil)
  
      }
      else
      {
        self.performSegue(withIdentifier: "Register", sender: self)
      }
  }
  </code></pre>
  
  <p>I expect it to jump over login controller but it throws error.</p>