Your application has presented a UIAlertController of style UIAlertControllerStyleActionSheet.
swift版本:3.0
Xcode版本:8.0
错误全文:
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.
错误原因:
在页面中设置了actionSheet类型的Alert,在iPhone环境可以正常显示,如下。但是在iPad环境下会报以上错误。原因是iPad上的actionSheet样式会直接转换为pop