liv a
liv a

Reputation: 3350

Iphone config file

In desktop applications when talking about a config file sometimes it's about letting the end client change some parameters according to his systems - for example entering his system IP or other parameters that can not be hardcoded, and must change by him because the user doesn't want you to know them.

I read about the option to create a settings.plist and reaching the value from NSBundle but how can the end client change the values in it?

Upvotes: 0

Views: 161

Answers (2)

Shamsudheen TK
Shamsudheen TK

Reputation: 31311

There are many Preference control types available. You can use a Text field.

The text field type displays a title (optional) and an editable text field. You can use this type for preferences that require the user to specify a custom string value.

The key for this type is PSTextFieldSpecifier.

To retrieve the edited value at run time, use the below code.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *iPAdress = [defaults objectForKey:@"IP address"];

Once these all done, Go To your iPad default Setting App-> You can view your application name listed under Apps section. Tap on it.

enter image description here enter image description here

Upvotes: 0

jrturton
jrturton

Reputation: 119292

You're talking about implementing a settings bundle. Once you've done that, the user will be able to adjust the values in the main iOS Settings app - there will be a section for your app.

Upvotes: 1

Related Questions