notifyPlayerAbortWithCompletion crash

Several publishers have encountered errors similar to:

iPhone:

Warning: Attempt to present <JASidePanelControllerSKZ: 0x17bd11f0>  on <_UIModalItemAppViewController: 0x17bde9f0> which is already presenting <_UIModalItemsPresentingViewController: 0x1c07d4d0>

iPad:

 *** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'

 

These errors were being caused by trying to load a Skillz view on top of a UIAlertView before it was dismissed. We encourage publishers to use a UIAlertView when a player tries to abort the game, so that they must verify they want to abort.

For example, if a player tries to quit, pop up a UIAlertView asking if they are sure they want to quit. This stops players from accidentally quitting a cash game when they don't want to.

However, when you call notifyPlayerAbortWithCompletion it will try to load a Skillz view. If you have not dismissed your UIAlertView yet, this will cause errors. Typically, the problem is that the publisher has implemented their UIAlertView code in a delegate method such as:

alertView:clickedButtonAtIndex:

This method is called when the player chooses a button from the alert view, but before the alert view is dismissed. Instead, you should use:

alertView:didDismissWithButtonIndex:

This method is called when the player chooses a button from the alert view, but is called after the view is dismissed, solving the problem.

Apple documentation for the UIAlertView delegate methods.