user1015777
user1015777

Reputation: 1021

reload/refresh UIView

I have created an application with multiple views. I have my main view (ViewController.h) and a couple of other views. The way I call the other views is by presenting modal view and then I go back by dismissing the modal view. Therefore the main view does not close, it stays in the background.

Now, I have a function in one of the "secondary" views that should affect the font size of the primary view. But I cannot find a way to refresh the primary view once I close the secondary view. The font size is saved into a global variable, therefore after I close the secondary view that global variable has a new value and I want this new value to be my font size.

Therefore, I would like to reload the primary view. How can I do that? my button for going back to the primary view has the following code

-(IBAction)goBack
{
[self dismissModalViewControllerAnimated:YES];
}           

Can anybody help me on that?

Thanks a lot guys

Upvotes: 0

Views: 3434

Answers (2)

Eric Petroelje
Eric Petroelje

Reputation: 60498

might want to try calling [view setNeedsDisplay] after the modal view controller is dismissed.

Upvotes: 1

Ankit Srivastava
Ankit Srivastava

Reputation: 12405

the viewWillAppear method will always be called when you go from second view to first view... try implementing the changes in this method...

Upvotes: 1

Related Questions