Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 9912 [details]
App crash in iOS 8 when clicking on UIActionSheet
Having an app crash when clicking on a button that displays a UIActionSheet.
Occurs only on iPad iOS 8.1, and only when in portrait mode.
We have the button on the left side of the split screen. Clicking on the button (aka bringing up the UIActionSheet) causes the left side (the parent view of the UIActionSheet) to be dismissed. The app crashes because UIActionSheet no longer has a parent to point back to (since the left side view is dismissed). When in landscape mode, the left side is not dismissed, and thus no crash.
We understand that for iOS, it is recommended to use UIAlertController. But then we will need to use OS detection, to switch between UIActionSheet and UIAlertController.
Is there any way to fix this crash, i.e. not dismiss the parent view when clicking on UIActionSheet?
Crash log attached.
The error message explains what you have to do:
Your application has presented a UIAlertController (<UIAlertController: 0x18bba5d0>) 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.
In any case this is not a bug in Xamarin.iOS, if you need further help please contact support using the support links listed in your Xamarin Account (https://store.xamarin.com/account/my/subscription).
Alright, thank you.
We ended up wrapping both UIActionSheet (which works in iOS7 but is deprecated in iOS8) and UIAlertController (which works in iOS8 but not defined in iOS7) in another class, which performs OS detection via UIDevice.CurrentDevice.SystemVersion.