Hello all, I am attempting to show an alert view as soon as the view appears (without using a button). In viewcontroller.m I have:
- (void) viewWillAppear:(BOOL)animated
{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"User Information" message: @"Hello"
delegate: self cancelButtonTitle:nil otherButtonTitles: @"Continue", nil];
[alert show];
[alert release];
}
and in viewcontroller.h I have:
IBOutlet UIView *alert;
I haven't done anything to my .xib file.
When run on the simulator I get the following in console:
2009-11-30 23:41:36.079 BatteryApp[867:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "BatteryAppViewController" nib but the view outlet was not set.'
Any ideas where I have gone wrong, something to do with my xib?
Edit // I connect alert to a new view in my xib, still no luck