1

I'm working on an app that uses an auth key to validate the login session for many methods (like getFriends, for example). I'll be calling these methods in different view controllers to the one which manages logging in, so I need a way to store the auth_key which is returned upon login.

Should I use a global variable? Also how is this best done? Is this what the "keychain" is for? Could you provide some resources for learning how to use the keychain?

I'm a first year student so please don't assume much experience.

1
  • 2
    Generally that is what the keychain is for - it has the added benefit that is is real persistence in a secure location. You can learn more about the keychain in its programming guide. Commented Mar 5, 2014 at 18:37

1 Answer 1

3

for this case I would use the keychain. Carl Brown wrote a great Controller to simply use the keychain. You can find it here: https://github.com/carlbrown/PDKeychainBindingsController

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.