title: iOS - Perform selector from UIViewController from willEnterForeground
body: <p>I have a -(void) method in my main UITableView class, which I use to refresh the data. It's somewhat complex, so I'm not going to post it here, but it is also called during viewWillAppear, so every time the tableView appears, the data is refreshed properly, except when it is opened from multitasking. </p>
  
  <p>I know that it is just supposed to provide the exact suspended state, but in my type of app, it needs to be refreshed when you open the app, every time.</p>
  
  <p>I've successfully done this:</p>
  
  <pre><code>- (void)applicationWillEnterForeground:(UIApplication *)application
  {
      [self.window.rootViewController viewWillAppear:YES];
  }  
  </code></pre>
  
  <p>Which refreshes the data perfectly, but creates a number of other problems, like screwing up the popViewController animation in my UINavigationController. I'm guessing that's not the best way to do it in the first place. (Anyone know how to fix that?)</p>
  
  <p>What I want to do is to just perform my refreshTableviewData method whenever I launch the app, including when it's multitasking.</p>
  
  <p>Not sure where to go from here, but I would <strong>hugely appreciate any suggestions!</strong></p>