2

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 2

1

You can save changed data in NSUserDefaults in settings , then when back to mainview, use saved data in -(void)viewWillAppear:(BOOL)animated: method in mainviewController or -drawView: method in mainview.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.