How can I present a modal view controller after selecting a contact?

北城余情 提交于 2019-12-25 04:35:17

问题


I'm trying to present a modal view controller after selecting a contact and it doesnt seem to be working.

In my -

(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person

method, I dismiss peoplePicker, create an instance of my new view controller, then present it with

[self.navigationController presentModalViewController:newController animated:YES];

and it doesnt work. However if i PUSH the view controller it works with this code:

[self.navigationController pushViewController:newController animated:YES];

How can I accomplish this?

Thank you,


回答1:


Simply call the presentModalViewController on your own controller instead of the navigation controller. If you're in the context of a UIViewController: [self presentModalViewController:newController animated:YES];



来源:https://stackoverflow.com/questions/2435617/how-can-i-present-a-modal-view-controller-after-selecting-a-contact

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!