I can't figure out how to refresh a ViewController, i have searched all google and this site, im stuck. My simple application is based on storyboard, and it start on a UITabBarController and i want it to refresh every time the settings is changed from another ViewController. That means i have to TabBar items one is the ( mainview with labels ) the other one is ( settings ) is there a simple way to to this?
2 Answers
You could use an NSNotification to send a message from one view controller to the other. But I agree with the other answer that regardless of whether you use shared NSUserDefaults or an NSNotification (or both), or some other means of communication between one view controller and the other (e.g. just give the primary view controller some methods that the settings view controller can call), what you're going to be communicating is state; the actual changes will be reflected because you've set up the primary view controller's viewWillAppear to consult that state and construct the interface accordingly.