1 | Thread 1: "Your application has presented a UIAlertController (<UIAlertController: 0x7f9f03960200>) of style UIAlertControllerStyleActionSheet from ***. 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
上UIAlertController style
为 UIAlertControllerStyleActionSheet
会崩溃
最简单的方法就是判断一下当前设备是否为iPad
如果是iPad
设置UIAlertController style
为UIAlertControllerStyleAlert