Present and dismiss modal view controller
First of all, when you put that code in applicationDidFinishLaunching, it might be the case that controllers instantiated from Interface Builder are not yet linked to your application (so “red” and “blue” are still nil). But to answer your initial question, what you’re doing wrong is that you’re calling dismissModalViewControllerAnimated: on the wrong controller! It … Read more