title: want to call a method in the presentingViewController after user has clicked done
body: <p>Noobie iOS developer with an adopted iOS app here.</p>
  
  <p>I have a settings piece of an iOS app and when the user clicks done, I want the modal view controller (which it currently does) and I want to call a function called updateMainUI in the presentingViewController.  </p>
  
  <p>Here's the method I am calling:</p>
  
  <pre><code>- (void)done:(id)sender
  {
    [[self presentingViewController] dismissViewControllerAnimated:YES completion:nil]; // works 
    [[self presentingViewController updateMainUI]; //doesn't work
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>No visible @interface for 'UIViewController' declares the selector 'updateMainUI'
  </code></pre>
  
  <p>But I have declared this in the presenting controller </p>
  
  <pre><code>@interface LocationsViewController : UITableViewController &lt;CLLocationManagerDelegate, UISearchBarDelegate, UISearchDisplayDelegate&gt;
  -(void)updateMainUI;
  </code></pre>
  
  <p>But it's odd that the error should be about UIViewController when the presenting controller is a UITableViewController.</p>
  
  <p>Any ideas on how to get the updateMainUI working? And what I'm doing wrong?</p>
  
  <p>thx</p>
  
  <p><strong>edit #1</strong>
  This is how I'm creating this - any idea how to get a refernce to the *nearbyViewController?</p>
  
  <pre><code>UIViewController *nearbyViewController = [[LocationsViewController alloc] initWithNearbyLocations];
  UINavigationController *nearbyNavigationController = [[UINavigationController alloc] initWithRootViewController:nearbyViewController];
  ...
  self.tabBarController = [[UITabBarController alloc] init];
  self.tabBarController.viewControllers = [NSArray arrayWithObjects:nearbyNavigationController, browseNavigationController, eventsNavigationController, nil];
  </code></pre>