How to reset an iOS application state after a user clicks sign out?

Ok first thing you have to do is make your main view implement the delegate for signout successful. In this you got to reset all the data and views which will be recreated/repopulated when a new user signs in.

Ok first thing you have to do is make your main view implement the delegate for signout successful. In this you got to reset all the data and views which will be recreated/repopulated when a new user signs in. Inorder to achieve this you can analyse your code/logic as to what is created on a new user .

The cleanest way would be to create a new set of view controllers and set them to the viewControllers of the UITabBarController object but it needn't be the cheapest always. This will be something that you need to check if it's viable or not. Otherwise, you'll have to to consider adding reset methods to the view controllers.

If the tab is a navigation controller, popToRootViewControllerAnimated: and reset the first view controller. This one is a bit of effort to implement compared to the former approach.

The Cocoa way = KVO (key value observing). Controllers interested in being informed about login state change register themselves as observers on login component/controller/whatever instance does the login. After login/logout this component notifies all observers about state change.

Those then do all necessary actions: populating UI with user data after log in or resetting them after log out. Very flexible pattern that avoids unnecessary dependencies between components.

When ever you go to new controller just allocate the whole controller again. And don't forget to release once the navigation is done. Heres the sample code example to do it -(void)goToFormController { FormViewController *objFormViewController = FormViewController allocinitWithNibName:@"FormViewController" bundle:nil; self.

NavigationController pushViewController:objFormViewController animated:YES; objFormViewController release; } Happy iCoding...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions