Iphone ABPeoplePicker调用所选的号码
我正在使用人员选择器,以便用户可以从联系人中选择一个电话号码,以便在应用程序中使用 当用户点击该号码时,手机应用程序打开,该号码被呼叫Iphone ABPeoplePicker调用所选的号码,iphone,abpeoplepickerview,Iphone,Abpeoplepickerview,我正在使用人员选择器,以便用户可以从联系人中选择一个电话号码,以便在应用程序中使用 当用户点击该号码时,手机应用程序打开,该号码被呼叫 有什么方法可以阻止这种情况吗?请查看ShouldPerformanceDefaultActionforPerson: - (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRe
有什么方法可以阻止这种情况吗?请查看ShouldPerformanceDefaultActionforPerson:
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)aPerson
property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue {
if(property == kABPersonPhoneProperty) {
//save the number
return NO;
}
return YES;
}
--编辑--
上面的方法是针对ABPersonViewController的,我把它误认为是ABPeoplePicker。ABPeoplePicker的逻辑与上述相同,只是您将使用此委托回调:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
我只是忘了在shouldContinuea中返回NO在选择Person:method之后,我不知道您从哪里得到shouldPerformedCallActionForPerson:from,这不是委托方法之一