I've encountered a strange problem in my IOS 8 people picker delegate code. Only the
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker;
{
[self dismissViewControllerAnimated:YES completion:NULL];
}
method is being called. I have reviewed other questions and have made the important IOS 8 delegate method changes for selecting a contact by calling the old IOS 7 method
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier: (ABMultiValueIdentifier)identifier {
[self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier];
}
but it is never called.
I am setting the delegate in the calling viewcontroller didLoad,
and it works perfectly in ios 7. This is a storyboard application.
I saw the same question asked in a comment here: ABPeoplePickerNavigationController changes with iOS8?
but never found an answer. Obviously a mistake somewhere on my part, but I can't find it.
UPDATE: As requested, here is how I set the delegate:
self.picker = [[ABPeoplePickerNavigationController alloc] init];
self.picker.peoplePickerDelegate = self;
And, in @interface:
@interface TreatmentsAddEntryTVC : UITableViewController<UITextViewDelegate,ABPeoplePickerNavigationControllerDelegate>