★ TouchArcade needs your help. Click here to support us on Patreon.

Set default value of a string in settings?

07-25-2009, 09:42 PM
#1
Joined: Mar 2009
Location: Singapore
Posts: 1,770
Send a message via AIM to kohjingyu
Set default value of a string in settings?

Hey guys,
Does anyone know how to set the default value of a string in settings? Like when the user starts it the first time?
07-26-2009, 04:26 AM
#2
Joined: Jul 2009
Posts: 1
Take a look at NSUserDefaults class
07-26-2009, 05:32 AM
#3
Joined: Mar 2009
Location: Singapore
Posts: 1,770
Send a message via AIM to kohjingyu
Lol, I just need this info. Like in the settings app in iPhone. Is it creating a new key called DefaultValue?

Oh, and did you join just to tell me this?
07-27-2009, 03:44 AM
#4
Joined: Mar 2009
Location: Singapore
Posts: 1,770
Send a message via AIM to kohjingyu
Okay, I found out. You have to create a new string called DefaultValue and set what you want the default value to be.