项目出现过的一些错误

2017-04-26  本文已影响0人  Amok校长

1. 报错一:

Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller’s popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.

当在iPad上运行上面这段代码的时候,如果没有设置如下两个属性 alertController.popoverPresentationController.sourceView

alertController.popoverPresentationController.sourceRect

会导致程序crash。然而在iPhone上没有这样的问题。

上一篇下一篇

猜你喜欢

热点阅读