views:

594

answers:

3

I hoping to create a custom Settings view, similar to the Settings application, but with more control over the UI and access to some settings (i need to lock some of the settings).

Obvously, there are a variety of UI elements mixed in each row of application's UITableView. For example, the 'Airplane Mode' setting shows a UISwitch, while the 'Wi-Fi' setting has a text value adjacent to the disclosure symbol ('>'). Further complicating matters, is the grouping of these settings.

I have some general questions about the approach I should take:

  • Seems like i need to save the name of the setting, its current value, its grouping, and the type of UI element(s) needed to modify its value. i would like to make use [NSUserDefault standardUserDefaults], but not have these settings appear in the Settings application. I'm guessing that I will need to create my own settings-persistence class.

  • is it better to build each one of these complex UI-element combinations in code or to create a series of custom views based on the UITableViewCell and load the appropriate one? i'm guessing the latter.

  • some of the setting require that i load another view to select its value. assuming that the application is based on the Utility pattern, should the SettingsView manage the navigation stack, rather than having the app delegate do so?

Thanks for your time and comments.

Craig Buchanan

A: 

I would love to know how to do this also, any luck?

mracoker
No. I haven't spent any time working on this since I posted the question.BTW, your question should have been added as a comment to my question rather than an answer to it. Thanks for the interest, though.
Craig
i didnt see the comment link as i did here, do they disappear after a bit?
mracoker
+2  A: 

If you're just looking at displaying your Settings.bundle in your app, I suggest you take a look at the InAppSettingsKit at http://www.inappsettingskit.com/ Or you could at least use the framework as a starting point.

As for your general questions, here's my take:

  • For persistence, I would recommend simply persisting an NSDictionary of your settings to a plist file in your App's Document folder either using NSPropertyListSerialization or NSDictionary's writeToFile:atomically:

  • I suggest building a series of custom nibs and caching the views once they are loaded

  • Definitely have your Settings view manage the Navigation stack, that way your settings view can be reused in other projects easily.

mmoris
Thanks for the suggestion. I'll take a look at it.
Craig
A: 

Here is another "in app settings" open source project: mySettings just another option...

mracoker