I want to show an alert when i toggle the switch of the iPhone application settings bundle. Can anyone please help me out how to do it.
Asked
Active
Viewed 385 times
1 Answers
1
When a switch in Settings.app is toggled, your app is in the background. However, if you would have read the Developer documentation you would have seen that there is a NSUserDefaultsDidChangeNotification
available that you can subscribe to and show your alert when the app is back in the foreground.
Reading the documentation and showing a little more research effort really helps, it's what developers do every day.

Pripyat
- 2,937
- 2
- 35
- 69
-
Hi David i want to show the alert in the settings screen itself like an action sheet is displayed in safari settings when clear history is clicked. – Phaniteja Dec 15 '11 at 12:59
-
That won't happen. `MobileSettings.app` is a separate application, with some of its settings powered by Settings bundles. The Safari pane has been created programmatically, hence the dialog. You **cannot** replicate that. – Pripyat Dec 15 '11 at 16:24