- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:@"testTitle"
message:@"test"
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* okAction = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
NSLog(@"User clicked button called %@",action.title);
}];
UIAlertAction* cancelAction = [UIAlertAction
actionWithTitle:@"Cancel"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
NSLog(@"User clicked button called %@",action.title);
}];
[alertController addAction:okAction];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:nil];
}
选择一个属性后,警报将显示一秒钟,然后自行解散。
如何防止ABP驳回警报? 要么 如何使用其他事件将警报提升给用户。