我正在运行以下使用Apples地址簿UI的代码。取消方法有效,但我的应用继续选择后没有。当我点击地址簿视图控制器中的联系人时,我希望记录单词Test。我应该使用另一种方法吗?
-(void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker {
NSLog(@"Test");
[self dismissModalViewControllerAnimated:YES];
}
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
NSLog(@"Test");
return NO;
}
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
NSLog(@"Test");
return NO;
}
答案 0 :(得分:4)
不推荐使用此方法。 Apple文档说:
使用
peoplePickerNavigationController:didSelectPerson:
或
peoplePickerNavigationController:didSelectPerson:property:identifier: