Paradise lost?

A couple of years ago, I wrote a blog post about displaying and dismissing a view controller in an iPhone application. To get rid of your view controller from within that view controller, you would simply run this line of code:

[[self parentViewController] dismissModalViewControllerAnimated:YES];

Alas, with the update to iOS SDK version 5, this no longer works. And in fact, if you spelunk through the UIViewController.h file, it does say that as of 5.0, it will no longer return the presenting view controller.

Luckily, you can just do this instead:

[self dismissModalViewControllerAnimated:YES];

BTW, happy birthday to Roger Moore, star of the excellent films “The Cannonball Run” and “ffolkes”.

Leave a Reply