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上没有这样的问题。
网友评论