Iphone – How to remove all the view along with rootView from UINavigationController in iPhone

iphone

I have an UIView added in the main window with a controller. On clik of a button on this view I want to load a UINavigationController which will migrate to multiple views pushing them one by one on stack. Now what I want to do is when user reaches at the end of views, in the last view I have a done button. ON clik of this button I want to move back to my first screen unloading the NavigationController from the memory.

What is the best way to do it since popToRootViewController takes you to the first screen of UINavigationController which is my second screen.

Best Answer

You basically want to remove the navigation controllers view, so why cant you just say [navigationController.view removeFromSuperView] ?

Related Topic