I’ve looked at the Apple appPrefs code sample, but that seems to be for navigation controllers only. I’m working with an iPad UISplitViewController that has simple root and detail VCs.
I can change certain settings (colors, date formats, etc) but currently, I have to restart the app to have the changes effected. I would prefer not to have to restart the app.
I’m using a system of loading the settings when the app starts each time. I can get a notification system to work, but I don’t know how to reload the view controllers.
Any ideas how to do this (I guess reload the views somehow).
Thanks for any tips/advice. I can post some code if relevant.
If you use
settings bundle to manage preferences from the Settings app:From what you said in your question, you already know how to get a notification(
UIApplicationDidBecomeActiveNotification) when your app becomes active, right?If so, the only problem left is how to reload your view after you receive the notification. Other than
UITableView, which can be easily reloaded by calling[tableView reloadData], you have to reload your view by assigning values to the UI controls that you want to reload just as you set them up initially. Say you have aUILabellabel you want to reload with the newly set preference value, you just write code like this:If you are using
in app preferences setting:If the preferences view controller does not display simultaneously with the SplitViewController. Reload your views in their controllers’
viewWillAppear:methods:Otherwise, make the SplitViewController the delegate of, or assign it to an ivar of, the preferences view controller, and notify it of the preferences changes when appropriate — immediately after changing any single preference if you prefer in realtime update, or after all the changes are done if you prefer batch update: