Peoplepickerdidselectperson在选择人员后继续解雇

时间:2015-01-27 20:11:41

标签: ios objective-c abpeoplepickerview

对于我的应用,我正在尝试检测所选人员的联系人是否包含超过1个电话号码。如果它只包含1个数字,我想使用

    -(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;
}

并获取电话号码。但是,如果它包含多个,我想使用

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

以便用户可以选择要使用的电话号码。但是,每当使用

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

}

选择一个人后,它总是会自动关闭视图。我尝试添加

[self dismissViewControllerAnimated:NO completion:nil];

进入第一种方法,但似乎也没有工作,视图仍然自行解散。如何防止视图自行解散或者我应该使用另一种方法?

最佳

0 个答案:

没有答案