//联系客服
UIAlertController * alertController=[UIAlertController alertControllerWithTitle:@"联系客服" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
[alertController addAction:[UIAlertActionactionWithTitle:@"400-856-****"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction *_Nonnull action) {
UIWebView *webView = [[UIWebViewalloc]init];
NSURL *url = [NSURLURLWithString:@"tel://400856****"];
[webView loadRequest:[NSURLRequestrequestWithURL:url ]];
[self.viewaddSubview:webView];
}]];
[alertController addAction:[UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction *_Nonnull action) {
}]];
[selfpresentViewController:alertControlleranimated:YEScompletion:nil];
meTableViewCell * cell=[tableViewcellForRowAtIndexPath:indexPath];
//不加下面代码,会在iPad上崩溃
UIPopoverPresentationController *popover = alertController.popoverPresentationController;
if (popover) {
popover.sourceView = cell;
popover.sourceRect = cell.bounds;
popover.permittedArrowDirections =UIPopoverArrowDirectionAny;
}