All the examples i've seen for presenting a modal look very simple and i've been able to create one in a sample project quite easily. So there must be something basic i'm missing.
I've created an ipad app that has a tabbarcontroller with 3 items. There is also a pop over menu that functions just fine on the 1st item. On this same item i want to have a a modal come up so the user can add new data. No matter what I do I can't seem to make the modal appear.
Currently my code looks like this:
-(IBAction) addNewBtnPressed: (id)sender {
NSLog(@"Add Crop Button pressed");
AddViewController *viewController = [[AddViewController alloc] initWithNibName:@"AddView" bundle:nil];
// viewController.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self presentModalViewController:navController animated:YES];
[navController release]; [viewController release];
}
I have the delegate line commented out as it fails with a compiler error: Request for member 'delegate' in something not a structure or union.
I only have it in there because i've seen it in some examples of how to present a modal view. My modal view .xib file is just an empty view at the moment.
I've also tried self.tabBarController, self.ParentView... to try to get the modal view to appear.
There must be something basic i've missed. It seems like a simple enough thing to do.