cadets-ca / ets

MIT License
5 stars 3 forks source link

Crashes when Sign in Flight (under Pilot Options) is initiated. #56

Closed huguesfcadets closed 4 years ago

huguesfcadets commented 4 years ago

Next Steps

To resolve this issue, please revise your app and test it on a device to ensure that it runs as expected.

Resources

For information on how to symbolicate and read a crash log, please review Tech Note TN2151 Understanding and Analyzing Application Crash Reports

crashlog-D7F31864-0F66-4891-88B9-B0B114F07DC2.txt crashlog-8828296F-280C-4A22-9130-5063A8E0F4EE.txt Screenshot-0314-162432 crashlog-167FA461-B180-4058-B005-0228E7C870AF.txt Screenshot-0314-162617

huguesfcadets commented 4 years ago

Exception:

Thread 1: Exception: "
Your application has presented a UIAlertController (<UIAlertController: 0x7fc267851800>) 
    of style UIAlertControllerStyleActionSheet 
        from UINavigationController (<UINavigationController: 0x7fc26b035a00>). 

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."

Fix

controller.popoverPresentationController?.sourceView = cell.contentView // fix #56

The popoverPresentationController will be nil on iOS, so this as no effect when on iPhone. Using the cell.contentView, will have the popover with a callout pointing to the cell from which the event originated. The same applies to Sign out flight and Sign Out All Squadron Cadets.