Ios 在没有popover的iPad上显示UIAlertController(警报样式)安全吗?

Ios 在没有popover的iPad上显示UIAlertController(警报样式)安全吗?,ios,cocoa-touch,uialertview,uialertcontroller,Ios,Cocoa Touch,Uialertview,Uialertcontroller,在我的应用程序中,当用户点击屏幕上的按钮时,我会显示一个UIAlertController。我使用UIAlertController或UIAlertView,具体取决于API的可用性(因为我的应用程序同时支持iOS 7和iOS 8) 我只是想向用户显示一个警报视图,因此我正在为我的UIAlertController使用。alert样式 当用户在iPad上时,是否可以安全地显示UIAlertController(Alert样式),而无需配置popover 我在网上看到了一些教程。据我所知,如果使用

在我的应用程序中,当用户点击屏幕上的按钮时,我会显示一个
UIAlertController
。我使用
UIAlertController
UIAlertView
,具体取决于API的可用性(因为我的应用程序同时支持iOS 7和iOS 8)

我只是想向用户显示一个警报视图,因此我正在为我的
UIAlertController
使用。
alert
样式

当用户在iPad上时,是否可以安全地显示
UIAlertController
Alert
样式),而无需配置
popover

我在网上看到了一些教程。据我所知,如果使用
UIAlertController
Action Sheet
样式),我需要配置一个popover,否则应用程序将崩溃。我只想知道它是否与
警报
样式
UIAlertController
的工作方式相同


我在我的iPad上做了一些测试,没有popover,应用程序不会崩溃。但我想确保这是安全的。

您从未将
UIPopoverController
UIAlertView
UIAlertController
一起使用(无论其样式如何)

UIAlertController
样式为“动作表”时,iOS将在内部使用iPad上的popover,但这不是你自己处理的


所以你没什么好担心的。使用
UIPopoverController
就像使用
presentViewController:animated:completed:
方法一样,无论设备和您是否正常。

啊,我明白了。谢谢你的澄清。起初我很困惑,因为以前在运行iOS8+的iPad上演示UIActivityViewController时,我必须设置其popoverPresentationController属性的sourceView和sourceRect。否则,它将在运行iOS 8的iPad上崩溃。所以我想知道在使用UIAlertController时是否也是这样,这是不同的。当UIAllertController用作操作表时,需要设置sourceView和其他属性。