如何防止ABPeoplePickerNavigationController自动关闭呈现的视图

时间:2015-02-08 11:50:00

标签: ios objective-c

- (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驳回警报? 要么 如何使用其他事件将警报提升给用户。

0 个答案:

没有答案