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
MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
Any ideas why it would be nil?