tags:

views:

108

answers:

1

Is there any way to set/update values in the settings.bundle from within your app. I am fine reading in values from the preferences into NSUserDefaults but was wondering whether you can set values from within the app.

I have a web-app which I am making a iPhone client for and was thinking to include the users account details in the settings.bundle. This is fine if the user only updates the values through the Apple Application Preferences screens, but what if the user updated those values in the web app. I wanted to pull down the values from the web and then "update" the values in the settings.bundle from within the App.

I am guessing that this is not possible and that maybe I need to create my own "in-app" settings screen? But thought I would check with you all first ...

A: 

You're asking two questions here.

The first one is if you can update settings from within the application. You assume you can't, but you can quite easily. Just use NSUserDefault's setObject:forKey: method.

If you want to do in-app settings, I'd start here: http://stackoverflow.com/questions/1203266/how-to-simplify-in-app-application-settings-management

Steven Fisher
perfect thanks, simple when you know how... for some stupid reason I thought NSUserDefaults was "read-only". I now see that the setting bundle is a mechanism to define the structure and set some defaults. NSUserDefaults provides the power thx again
joneswah
You can store things that don't fit into the settings app there, too. I mean, keep it to some reasonable limit, but a few things (username, password) make sense.
Steven Fisher