开发者

How to dismiss modal view controller from UITabBarController

开发者 https://www.devze.com 2023-02-02 19:32 出处:网络
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 declare

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消