在调用 shouldPerformDefaultActionForPerson 之前显示 iOS9 native 拨号程序

标签 ios iphone uitableview ios9 abpersonviewcontroller

我刚刚注意到升级到 iOS9 后我的应用程序出现了不同的行为。我有一个显示手机设备联系人的 View 。

我的代码如下:

if (... == YES)
    {
        ABRecordSetValue(aContact, kABPersonEmailProperty, email, &anError);
        if (anError == NULL)
        {
            ABUnknownPersonViewController *picker = [[ABUnknownPersonViewController alloc] init];
            picker.unknownPersonViewDelegate = self;
            picker.displayedPerson = aContact;
            picker.allowsAddingToAddressBook = YES;
            picker.allowsActions = YES;
            picker.alternateName = @"John Appleseed";
            picker.title = @"John Appleseed";
            picker.message = @"Company, Inc";

            [self.navigationController pushViewController:picker animated:YES];
        }

然后我使用委托(delegate)来做一些决定

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person 
                                property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
    {
        //make decisions 
        return YES or NO;
    }

用户点击电话号码。

在IOS8>> 代码到达shouldContinueAfterSelectingPerson然后出现原生拨号器

在 IOS9 中>> native 拨号器出现在代码到达 shouldContinueAfterSelectingPerson 之前。

有什么办法可以解决吗?

最佳答案

我也遇到了同样的问题。我注意到的是,如果您在委托(delegate)方法中进行某些计算(显然需要一些时间来进行该计算)并且会调用 native 拨号器。

所以,为了避免这个问题,我立即从这个委托(delegate)方法返回 NO 并在不同的线程中执行我的计算。这当然是一种解决方法,希望该问题在下一个 iOS 版本中得到解决。

关于在调用 shouldPerformDefaultActionForPerson 之前显示 iOS9 native 拨号程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32887251/

相关文章:

iphone - 在 iPhone 上点击时清除文本字段框

iphone - iOS AudioServicesAddSystemSoundCompletion回调发生1秒延迟

ios - 多设备混合应用程序平台 View

ios - 从带有搜索栏的 TableView Controller 移动到 UISearchDisplayController

ios - 如何使用段控制 ios 在两个 UIView 之间正确切换?

ios - UITableViewCells 未出现在 iPhone 5S 上的 iOS 7.1.2 中

iphone - iOS UICollectionView 放大中心单元格

ios - 如何: import Scanned data from an ID into text boxes on separate view IOS (BLINKID)

objective-c - 演示应用程序的 iOS 项目结构

ios - 跨部分重新排序行时更新无效