I understand the difference between dismissViewControllerAnimated:completion:
and popViewControllerAnimated:
, as described on Stack Overflow and here:
-dismissViewControllerAnimated:completion:
method is used to dismiss an UIViewController, which was presented by the method:-presentViewController:animated:completion:
.
-popViewControllerAnimated:
method of UINavigationController is used to pop a controller shown by-pushViewController:animated
method of UINavigationController.
I recently caught a mistake in my app, where I was using [self dismissViewControllerAnimated:completion:]
to dismiss a VC that was presented with a push in a navigation embedded app. I french fried when I should have pizza'd. I didn't catch the mistake because everything worked fine and my VC was deallocated as expected.
My question: What are the consequences of mixing these two methods up?