Hi.
I'm realizing what a newbie I still am with this problem I have. I am trying to present a modal window in a project I am working on and it's not appearing. My solution was then to create an absolute basic project and get it working there first, so I would clearly understand my problem, but I can't get even this working :(
I add a ViewController to the MainWindow at applicationDidFinishLaunching. In this ViewControllers XIB, I have a button. The ViewController has the following header:
#import <UIKit/UIKit.h>
#import "ModalView.h"
@interface ViewBasedViewController : UIViewController {
ModalView *modalView;
}
- (IBAction)dooooIt :(id)sender;
@property (nonatomic, retain, readonly) ModalView *modalView;
@end
And methods:
#import "ViewBasedViewController.h"
@implementation ViewBasedViewController
@synthesize modalView;
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
}
- (void)dealloc {
[super dealloc];
[modalView release];
}
- (ModalView *)modalView {
if (modalView == nil) {
modalView = [[ModalView alloc] initWithNibName:@"ModalView" bundle:nil];
}
return modalView;
}
- (IBAction)dooooIt :(id)sender {
[self.navigationController presentModalViewController:modalView animated:YES];
}
@end
I'm obviously missing something very simple and I believe it's between my ears at this stage :)
Does anyone want to put a poor fella out of his misery?
Many Thanks
Chris