简体   繁体   English

iOS 8 ABPeoplePickerNavigationController多项选择

[英]iOS 8 ABPeoplePickerNavigationController Multiple Selection

I recently upgraded my iPhone and Xcode from iOS 6 to iOS 8 and I experienced the issue of the "default" action being performed when a phone number or email address is selected from the ABPeoplePickerNavigationController (by "default" action I mean, selecting a phone number starts calling that number and selecting an email address opens up a new email to that address). 我最近将我的iPhone和Xcode从iOS 6升级到iOS 8,我遇到了从ABPeoplePickerNavigationController选择电话号码或电子邮件地址时执行“默认”操作的问题(通过“默认”操作我的意思是,选择一部手机号码开始呼叫该号码并选择一个电子邮件地址,打开一封到该地址的新电子邮件)。

I implemented the new 我实施了新的

peoplePickerNavigationController:didSelectPerson:property:identifier : peoplePickerNavigationController:didSelectPerson:property:identifier

method of ABPeoplePickerNavigationControllerDelegate , which resolved the "default" action issue, but now I am unable to select more than one email address or phone number before the ABPeoplePickerNavigationController is dismissed, whereas I used to be able to pick any number of email addresses and phone numbers in iOS 6 by returning NO from the ABPeoplePickerNavigationControllerDelegate方法解决了“默认”操作问题,但现在我无法在ABPeoplePickerNavigationController被解雇之前选择多个电子邮件地址或电话号码,而我以前可以选择任意数量的电子邮件地址和电话号码在iOS 6中通过从NO返回NO

peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier: peoplePickerNavigationController:shouldContinueAfterSelectingPerson:属性:标识符:

method which no longer seems to get called. 似乎不再被称为的方法。 I have also tried setting the predicateForSelectionOfProperty property of the ABPeoplePickerNavigationController to nil, 我也尝试将ABPeoplePickerNavigationControllerpredicateForSelectionOfProperty属性设置为nil,

[NSPredicate predicateWithValue: YES] 

and

[NSPredicate predicateWithValue: NO],

but the ABPeoplePickerNavigationController still dismisses as soon as a property is selected. 但是一旦选择了属性, ABPeoplePickerNavigationController仍然会解散。

Any idea how to prevent the ABPeoplePickerNavigationController from dismissing when a property is selected? 知道如何防止ABPeoplePickerNavigationController在选择属性时解散吗?

Thanks, 谢谢,

Vatche Vatche

Moving the comment as an answer since it proved to be helpful :-) 将评论作为答案移动,因为它被证明是有帮助的:-)

I ended up subclassing ABPeoplePickerNavigationController and overriding dismissViewControllerAnimated to be able to decide whether to dismiss it or not, when a property is selected. 我最终dismissViewControllerAnimatedABPeoplePickerNavigationController并重写了dismissViewControllerAnimated ,以便能够在选择属性时决定是否关闭它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ABPeoplePickerNavigationController随iOS8变化? - ABPeoplePickerNavigationController changes with iOS8? 在iOS 7中的ABPeoplePickerNavigationController中添加barButtonItems - Add barButtonItems in ABPeoplePickerNavigationController in ios 7 在iOS 8中自定义ABPeoplePickerNavigationController的导航栏 - Customizing ABPeoplePickerNavigationController's navigationbar in iOS 8 在iOS8上将ABPersonViewController推送到ABPeoplePickerNavigationController - Pushing ABPersonViewController to ABPeoplePickerNavigationController on iOS8 ABPeoplePickerNavigationController谓词,用于选择带predicateForEnablingPerson的联系人 - ABPeoplePickerNavigationController predicate for enabling selection of the contact with predicateForEnablingPerson 在iOS中选择图像 - Multiple Selection Of Image in iOS iOS tableView多项选择 - iOS tableView multiple selection iOS 8:无法更改所有ABPeoplePickerNavigationController的导航栏 - iOS 8: Cannot change the navigation bar at all of the ABPeoplePickerNavigationController iOS 6通过ABPeoplePickerNavigationController创建新联系人 - iOS 6 Create new contact via ABPeoplePickerNavigationController ABPeoplePickerNavigationController和UIImagePickerController无法在ipad iOS7上正确显示 - ABPeoplePickerNavigationController and UIImagePickerController not displaying correctly on ipad iOS7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM