I’ve used NSUser Defaults in my app and generally it stores the user data while signing up and deletes those data while logging out. So, when the user signsup and then logs in, the stored data in NSUser Defaults makes the auto login part effective, even when the user closes the app and re opens it again.
But the problem is, when the user logs out, its asking him to signup again. What i want is that, if the user signsup, that information should be stored permenantly and when he signs out, it shouldnt ask him to signup again as it should only clear the memory of the login page , so that the other user can use the same app.
Iam using iOS 5. So, can i use SQLite database(to store the signedup info permenantly) and NSUser Defaults(to clear the memory of the login page) together in my app? Or is there any alternate solution to this?
It seems that your app is offline and multiple users can signup and login in the same app (phone), so i think that best approach will be to save the signup data in sqlite database (you can use coredata)
and login info in NSUserDefaults. So when user logsout you just clear your NSUserDefaults value only. Also at login time you can check from your databases that user exist or not as all the users data who have signedup is stored in your database. Also if there is a functionality that user can delete his account, than just clear that user entry from the database.
Hope this helps….