saving login state
Posted on 2011-03-08
I'd just like to make it clear that I'm new to iphone development so still learning how to do stuff.
Anyway I have a main view which has the main menu for my app. On viewDidAppear I have it immediately displaying a login view modally. You can then put your login info in and it sends that info via http post, does a check to see if the user exists, if it does it returns the users unique id and maybe a bool to say they are logged in.
So whats the best way to store that user id and the login state in the app. Once that info is saved I can check against it during viewDidAppear to decide if the login view should be displayed.
Then when the app quits the login state is reset to not logged in.
I have all the http posting and server side stuff working correctly. I'm just not sure of the best way to save that the user is logged in.
Any help on the best way to achieve this would be great.