开发者

displaying a ABPeoplePickerNavigationController inside a UIPopover

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜