views:

31

answers:

2

Having a real problem with this one...Tried using cookies to store variables, etc. but no luck.

Writing an iPhone app where the User has to log in. There is an HTTPS call to get the person's userid, which is used practically everywhere else in the app, so that either has to be stored in a global variable or a cookie (for sending messages to other users, etc.)

I tried the cookie route, but am having great difficulty storing (and retriving) a user ID in a cookie.

The User should be able to then close out of the app and then reboot it and have the app retain their User ID as well, so I'm not sure global variables are necessarily the solution to this.

Are there any best practices or suggestions?

A: 

Persistent storage of settings should be handled via the user defaults - see the Introduction to User Defaults.

Georg Fritzsche