I have an external device that has a button. When you press this button, it switches view controllers. When I press the button slowly, they transition just fine. But, when I press the button too fast, the app crashes with the error:

Terminating app due to uncaught exception NSInternalInconsistencyException, reason: Attempting to begin a modal transition from <SViewController: (numbers)> to <VViewController: (numbers)> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed

I have no idea how to fix this issue. This is the code I use to switch between view controllers. I put this if statement in each view controller (of course switching out the View Controllers):

So I would like to challenge your reading skills here. It says check in viewDidAppear. In viewDidLoad, the transition has not yet completed, and will crash if you try to start another one.
–
mrosalesJun 25 '13 at 17:28

In viewDidAppear it MUST have finished, because your new view has vinished appearing
–
mrosalesJun 25 '13 at 17:28

1

alternatively, just use the completion block in presentViewController:animated:completion:. By definition, this block is called when the transition finishes.
–
mrosalesJun 25 '13 at 17:29