It is not possible to dismiss a controller and present another within the same runloop.

Originator:steipete
Number:rdar://19045528 Date Originated:20-Nov-2014 06:10 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 8.1.1
Classification:Serious Bug Reproducible:Always
 
Summary:
It is not possible to dismiss a controller and present another within the same runloop. This seems like an arbitrary restriction which is especially problematic with the transition to UIViewController-based alert views.

Steps to Reproduce:
Open the attached example, click on the button inside the popover, then check the log.

Expected Results:
Should show an alert view displaying “Will never be displayed”. But doesn’t happen.

Actual Results:
Shows another alert after some time explaining the bug.

Regression:
This worked with UIAlertView.

Notes:
Using a dispatch_async on the main thread would fix the issue, but this is code smell.

Comments

Example: http://cl.ly/143o2r2N3Y42/download/ViewControllerDismissalWarning%20(rdar%3A%3A19045528).zip


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!