title: UIApplication Delegate weak reference causing it to be nil?
body: <p>When a UIApplicationDelegate is instantiated from:</p>
  
  <p><code>UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]))</code></p>
  
  <p>Tthe AppDelegate remains in memory even though the <code>[[UIApplication sharedApplication] delegate]</code> property is a weak reference.</p>
  
  <p>However, if you unset and re-set the delegate property, like so:</p>
  
  <pre><code>id originalDelegate = [[UIApplication sharedApplication] delegate];
  [[UIApplication sharedApplication] setDelegate:nil];
  [[UIApplication sharedApplication] setDelegate:originalDelegate];
  </code></pre>
  
  <p>then it becomes invalid to use. Any idea why it initially is fine with a weak reference?</p>