In my application mainviewcontroller is pushing modalviewcontroller by using this
[navigationController pushViewController:_viewController animated:YES];
For going back to mainviewcontroller using popviewController
[self.navigationController popViewControllerAnimated:YES];
Now as per apple reference documentation delegate is used by the presented view controllers to notify the presenting view controller when it is ready to be dismissed.
But in my case i am not using presentviewController and dismissmodalviewcontroller. It means my done button cannot use delegate to navigate back to mainviewcontroller like this
[delegate dismissModalView:self];
So what code i should write in donebutton method so that it uses
-(void) dismissModalView:(UIViewController *)viewController;
{
[self.navigationController popViewControllerAnimated:YES];
}
to navigate back to mainviewcontroller.
help will be appreciated.
Thanks
Try this to go to the rootView, the first view on the stack:
Or to specify a viewController: