Why does [[UIApplication sharedApplication] delegate]; return a nil object
<p>I have an iphone application with multiple views and related controllers and xib files. In the controller for the first view that is loaded I am trying to access the delegate for the application but the object that is returned is nil   </p>

<pre><code>MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
</code></pre>

<p>Any ideas why it would be nil? </p>
