I have a UIPopover that has a navigationController stack. From the second view in that stack, I want to display an ABPeoplePickerNavigationController modally in the popover. I have this working, but when I dismiss the modalViewController, the original navigation controller for the UIPoover is missing from the popover. Is there a way to make this work properly? Code below:
(IBAction)showPicker:(id)sender {
ABPeoplePickerNavigationController *picker =
[[ABPeoplePickerNavigationCo开发者_JS百科ntroller alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle = UIModalPresentationCurrentContext;
picker.modalInPopover = YES;
[self presentModalViewController:picker animated:YES];
// self is the 2nd viewController in the original navigation stack
[picker release];
}
(void)peoplePickerNavigationControllerDidCancel:
(ABPeoplePickerNavigationController *)peoplePicker {
[self dismissModalViewControllerAnimated:YES];
}
Problem solved as below:
[self.navigationController presentModalViewController:picker animated:YES];
精彩评论