At some point in my application workflow, I have one showing UIViewController. And as I press the Home button, I leave the application, leaving it running in the background.
However, when I return to the app, I would like the showing UIViewController not to appear again. I would like it to be removed or destroyed or anything like that.
How can I accomplish that?
You may add observer to UIApplicationDidEnterBackgroundNotification in your
viewcontrollerclass. Try this in theinitmethod:then in the enterBackground method, you can pop or dismiss your
viewcontroller.remember call this
in the
dealloc