First of all, can we talk about iOS 5 here? Or is it still under NDA? If we can't talk about it, just ignore my question.
By testing my app with an iPad with iOS 5 installed I discovered a problem with my "modal" popover: This can be closed by tapping outside of it, in other words, it's not modal! I have no idea what I'm doing wrong.
A view controller opens the popover with this code:
AddProjectViewController *addProjectViewController = [[AddProjectViewController alloc] initWithStyle:UITableViewStyleGrouped];
[addProjectViewController setDelegate:self];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addProjectViewController];
[addProjectViewController release];
CGRect popoverFrame = [sender frame];
UIPopoverController *tempPopover = [[UIPopoverController alloc] initWithContentViewController:navController];
[tempPopover presentPopoverFromRect:popoverFrame inView:[self view] permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
self.currentPopover = tempPopover;
[tempPopover release];
[navController release];
The view controller that's inside of the popover has this line in it's viewDidLoad.
- (void)viewDidLoad
{
[self setModalInPopover:YES];
// Do other stuff
}
Is there anything missing?
[self setModalInPopover:[self isModalInPopover]];
in the viewDidAppear method, as I'm setting this value externally in the code which creates the view controller. – Preachment