I've an app with this layout:
When you open the app you see a login screen. You log in and you see a tabbar with 3 tabs. (The loginview is displayed with a presentModalView in the appdelegate of tabbar).
In the third tab there is a logout button. I want when logout button is pressed the app delete NSUserDefaults and show开发者_如何学运维s the loginview again. And if you login again the login screen disappear and you see the first tab of the tabbar.
How can I do this?
Do as follows,
Place your login view in first view controller.
Place your tabbar controller in second view controller.
Store the second viewcontroller instance in appDelegate (this will be used for navigation).
Now when the logout button is pressed,use the stored instance navigate your view.
精彩评论