iPhone Objective-C: Best way to handle logout user A -> login user B? -


I have an application that uses OAuth, which has something like this: if the user token request is valid A UITabBarController loads with stored four views, otherwise the user brings it to the login screen.

I realized today that if I am logged in to my app, log out and switch to another user, then the first user's data is displayed till I refresh it with no The tab, which was last seen by the previous user, is displayed (which is very strange for a user's perspective).

I thought about removing Tabber Controller and creating a new one, but I realized that I did not have to make sure that, how I set everything through the interface builder (In addition, I do not even know that this is the best way.)

What is a good way to log out of A -> Log in to B? Apart from this, if you need more information, I would be happy to expand.

Thank you!

I do this by doing this

login

  1. Load and display a long screen
  2. Load the root view controller in the background
  3. Enter the root view controller behind the login screen
  4. Remove the login / Release the login screen after login

logout

  1. Load the login screen and place it under the view stack (behind the root view)
  2. Root View Remove / release the controller (login looks)
  3. ... start with login 2

If you store specific data in user documents directory , Stores it in sub-directories as a directory name with a user name or an ID. One directory for each user


Comments