I need a data reset switch my application, I'd like to put it in Settings->Apps->MyAppName section of iOS. Being a destructive action I want iOS to prompt the user for confirmation. Is there a way to display an alertview style confirmation box from within app settings?
Placing the switch and alertview within the app is no problem to me, I just can't figure out how to display an alert from the settings page. Google searches haven't yielded anything so far.
Thanks
Putting the "delete all data" switch on the settings page of your application wouldn't do anything to the data stored by your app. Only a property within the NSUserDefaults
would become YES
. Since it is up to your app to delete all data the next time it becomes active (checking the NSUserDefaults
), you can display an UIAlertView
from your app that gets a confirmation from the user.
It is not possible to integrate such a logic right in the settings app.