I have a subclass of ABPeoplePickerNavigationController
to handle selecting a contact phone number in my app. Everything works great on iOS 7 and below.
On iOS 8, however, my ABPeoplePickerNavigationControllerDelegate
does not get hit when selecting a phone number. Instead, it just calls that phone number.
I noticed that the method I was using to handle contact selection in iOS 7 (peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:
) was deprecated in iOS 8. This method was replaced by peoplePickerNavigationController:didSelectPerson:property:identifier:
.
I know my delegate is set because I successfully receive the peoplePickerNavigationControllerDidCancel:
method callback.
Has anyone else experienced this issue?
Here's a code snippet of my ABPeoplePickerNavigationController
subclass:
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
[self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
...do stuff...
return NO;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
return YES;
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker {
[self dismissViewControllerAnimated:self.shouldAnimateDismiss completion:NULL];
}
predicateForSelectionOfProperty
? – BulterpredicateForSelectionOfProperty
affects this behavior, too, so I had to ask. Anyway, have you confirmed (with breakpoints or log statements) that these delegate methods are getting called at all? E.g. thatpeoplePickerDelegate
(note, notdelegate
) was correctly specified? – Bulter