0

For my app, I am trying to detect whether or not a selected person's contact consists of more than 1 phone number. If it only contains 1 number, I want to use

    -(void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person{

         [self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person];
            }

    -(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person{

[self dismissViewControllerAnimated:NO completion:nil];
return YES;
}

and get the phone number. However, if it contains more than one, I want to use

-(void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{
}  

so that the user can select which phone number to use. However, whenever using the

-(void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person{

}

after selecting a person, it will always dismiss the view by itself. I tried adding

[self dismissViewControllerAnimated:NO completion:nil];

into the first method but that didn't seem to work either and the view still dismissed itself. How can I prevent the view from dismissing itself or is there another method I should be using?

Best

joaquin
  • 31
  • 2
  • Did you implement the various `shouldContinueAfterSelectingPerson` delegate methods? Show more of your code. – rmaddy Jan 27 '15 at 20:36
  • yes, i tried adding '-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person' and added [self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person]; – joaquin Jan 27 '15 at 20:45
  • Please update your question with relevant code. Don't put it in the comments. – rmaddy Jan 27 '15 at 20:48

0 Answers0