Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top