views:

438

answers:

3

I have an application where the user can log in but i don't want the user to enter his credentials every time he wants to use the application. 1 time would be sufficient but how(and whats the best way) to save 2 strings that i can revive by starting the application.

A: 

Is there no API from Apple?

I haven't got access to the iPhone documentation, but at least there's an API for Mac OS X.

Georg
+9  A: 

The iPhone has a keychain API just like OS X. Or you could just store them using NSUserDefaults which would be easier but less secure.

Stephen Darlington
Please don't store them using NSUserDefaults, you wouldn't want too expose passwords of your users when they for example lose their iPhone.
Georg
Just be aware that the Keychain uses Triple-DES, in case that matters.
bbrown