views:

462

answers:

2

I'm building an iphone app, and I wanna use the iPhone's built in Preferences stuff. It looks like I put options in there, but I'm interested in putting a Reset button in the Prefs. I see that Apple's built-in apps like Safari have buttons in their prefs (Clear History, Clear Cookies, etc). I don't see a way to do this for SDK apps. Help!

+5  A: 

Your Settings bundle cannot contain any runnable code, so it's not possible to have buttons like safari (Clear History, Clear Cookies, etc).

Safari is a builtin application provided by Apple, therefore it has access to apis/privileges that normal AppStore applications don't.

You can see the list of possible elements here.

mfazekas
+1  A: 

One thing you can do, since you can set your own app's preferences during runtime, is create a "Reset preferences on next run" toggle.

When your app starts up, check for this setting and act accordingly if it is set to "On". Don't forget to reset the toggle as well. ;-)

Here's a Q&A that explains how to do this: How to change the app preference settings through code?

i-g