UIAlertController 在ipad中需要配置一下掛靠的控件痹换,而在iphone卻不需要的添寺。
下面代碼可以適配
UIAlertController *alert = [UIAlertController
??? ??? ??? ??? alertControllerWithTitle:NSLocalizedString(@"分組管理",nil)
??? ??? ??? ??? message:[NSString stringWithFormat:NSLocalizedString(@"分組:%@,? 請(qǐng)選擇您要進(jìn)行的操作",nil),title]
??? ??? ??? ??? preferredStyle:UIAlertControllerStyleActionSheet
??? ??? ??? ??? ];
if([EzSystemInfo isDevicePad])
??? {
??? ??? UIPopoverPresentationController *popPresenter = [alert
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?popoverPresentationController];
??? ??? popPresenter.sourceView = cell;
??? ??? popPresenter.sourceRect = cell.bounds;
??? ??? [self presentViewController:alert animated:YES completion:nil];
??? }
??? else
??? ??? [self presentViewController:alert animated:YES completion:nil];??? ???