title: Why all IBOutlet(s) found nil when viewdidload is called in App Delegate?
body: <p>My Xcode debugger reports, every other values include alive (bool value) is set, except <strong>all the IBOutlets</strong> found nil (<code>myLine</code>, etc.). By the way, everything works when I delete all the code in App Delegate, but I need this view to update frequently, so implement it in applicationWillEnterForeground is necessary. And another thing worth pointing out, in the configure view 1 and 2, I set each outlet's value. And I make app delegate call viewdidload method before that, so all the outlets should hooked up with code already, so those outlets shouldn't be nil. </p>
  
  <blockquote>
    <p>An error message in the debugger -- fatal error: unexpectedly found nil
    while unwrapping an Optional value</p>
  </blockquote>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      var alive : Bool = true
      var aliveDefault = NSUserDefaults.standardUserDefaults()
  
  
      //IBOulet Connections
  
      @IBOutlet weak var myLine: UILabel!
  
      @IBAction func buttontapped(sender: AnyObject) {
          alive = false
          NSUserDefaults.standardUserDefaults().setObject(alive, forKey: "alive")
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
          loadView()
      }
      func loadView(){
           alive = aliveDefault.boolForKey("alive")
           if alive = true {
              configureView()
            }else{
              configureView2()
          }
      }
  
      func configureView(){
          myLine.text = "Random text"
      }
  
      func configureView2(){
          myLine.text = "Random text 2"
      }
  }
  </code></pre>
  
  <p>App Delegate</p>
  
  <pre><code>func applicationWillEnterForeground(application: UIApplication) {
          // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
      ViewController().viewDidLoad()
      ViewController().configureView()
  }
  </code></pre>