I have an iOS app with a login view.
I need to have the login-data the whole time until the user ends the app or click “logout”.
How and where to store it?
Are something equel like “member variables” possible in iOS / objective C?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re going to be storing username/password data, it’s probably best to store it in the keychain. If you’re only looking to keep track of whether a user is logged in, then consider storing a flag of some kind in
NSUserDefaults. You can clear data when the application exits through theapplicationWillTerminate:method of your application delegate.