3

Do we have to work with the UIAlertController in the iOS8 or could we still work with the UIActionSheet?

I don't want massive changes in our code for iOS 8 compatibility, but I'm encountering several issues when working with the UIActionSheet on iPad.

For example I'm getting this exception when using the UIActionSheet:

UIPopoverPresentationController (<_UIAlertControllerActionSheetRegularPresentationController: 0x7c57bf90>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.

I understand that it is preferred to work with the new UIAlertController, but is there any workaround for this in order to continue to work with the UIActionSheet?

Also in places that the UIActionSheet actually shows (with no exception) it contains an arrow + it is not centred like before (iOS7) - I'm using the showInView (also tried to work with showFromRect but got the same results).

Tomer Peled
  • 3,571
  • 5
  • 35
  • 57
  • Are you using a popover to present the `UIAlertController` on iPad? – Moon Cat Aug 26 '14 at 11:26
  • 2
    I still don't want to migrate to the new UIAlertController, I'm using the UIActionSheet. – Tomer Peled Aug 26 '14 at 11:30
  • 1
    I'm seeing the same problem in our app. UIActionSheet seems to be broken in iOS 8. Unfortunately the API for UIAlertController is very different so it's painful to write code that supports both OS versions. – n8gray Sep 05 '14 at 00:59
  • 1
    I found solution by adding category of UIActionSheet read my question i write solution in question itself, http://stackoverflow.com/questions/24363761/uiactionsheet-crash-in-ios8beta – Jageen Sep 05 '14 at 04:15

1 Answers1

0

From the documentation its clear that UIActionSheet is deprecated. Means that you can still use it but in future in can fail or will be removed completely.

I highly recommend you to update to UIAlertController.

The exception you got on iPad is clear. As the UIAlertController with style actionSheet needs sourceView (the view from the actual controller will be presented) as its no more full screen (as its on iPhone).

Marek Staňa
  • 522
  • 7
  • 10