Hello, here is a iPhone programming beginner's question: How do I get to another view by pressing a button in my main view?
I have the following function which is executed when I press a button, and debugging it, he passes there, but my "Warning" view does not show up:
-(IBAction) showWarningView:(id)sender
{
if(self.showWarning == nil){
WarningViewController *nextView = [[WarningViewController alloc] initWithNibName:@"Warning" bundle:[NSBundle mainBundle]];
self.showWarning = nextView;
[nextView release];
}
[self.navigationController pushViewController:self.showWarning animated:YES];
}
My main RootViewController looks like this:
#import <UIKit/UIKit.h>
#import "WarningViewController.h"
@interface RootViewController : UIViewController {
IBOutlet UIButton *button1;
WarningViewController *showWarning;
}
@property(nonatomic,retain) WarningViewController *showWarning;
-(IBAction) showWarningView:(id)sender;
@end
I am using the navigation control of a UITableViewController but what do I have to use to just simply show my other view when I press a button in a view-based application? Thanks a lot!