How to dismiss modal view controller from UITabBarController
Currently im developing an iPhone Game...When app loaded a login page is seen...when logged in...from login view controller a welcome screen view controller with tabbar(UITabbarcontroller iVar declared inside and connected to tabbarcontroller with 开发者_开发技巧interface builder) is presented(using presentModalViewCotroller)..There the first tab is dealing with account ..loaded from accountController NIb and view controller...inside which there's a logout button...when clicked i need to go to login page under loginview controller...
Inside logout button click action method...i had coded like this [self dismissModalViewControllerAnimated:NO];
but on button click nothing happening...
first : parent--loginviewcontroller child--welcomescreen view controller Inside welcome screen,in account tab,on logout button click: how could i dismiss the above MVC....
can anyone give me a solution as soon as possible...its urgent...
simply try:
[self.parentViewController dismissModalViewControllerAnimated:YES];
[self.presentingViewController dismissModalViewControllerAnimated:YES];
where self is the view controller that's being presented modally at the moment.
Worked for me.
Try this:
[tabBarController dismissModalViewControllerAnimated:YES];
where tabBarController is controller in which we added all the tabs.
i just found it's answer, may be it will help somebody we need just one line of code
[self.presentingViewController.presentingViewController dismissModalViewControllerAnimated:YES];
精彩评论