Search code examples
iphoneiosobjective-cxcodesplitcontainer

How do I reload a container view when navigating backwards using a segue?


In Xcode I am have two container views implemented in a UIViewController. I use a modal segue to navigate forward on one view which correctly loads. My problem is that when I navigate back to the previous page my other container view does not reload automatically.

How do I manually force this container to load when navigating back?

Note: it will correctly load when I navigate forward to this page, however my problem only arrises when navigating backwards.

I have researched quite a few options but can't find a clear example of how to do this.


Solution

  • Place the reload code in this method

    - (void) viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:YES];
        // reload stuff
    }