I have a viewController called mainViewController that contains a UIWebView called “myWebView”. mainViewController presents a popover viewController called subViewController. In subViewController I have a button that is supposed to reload the myWebView. Doing something like this:
mainViewController *vc = [[mainViewController alloc] init];
does not work because it creates another instance of mainViewController. How can I reload the myWebView in the mainViewController that is currently presenting the popover window.
Unless I misunderstood your question, this seems fairly easy to accoumplish. I suppose you could sent a notification from UIPopoverController.
First in your main view controller in viewWillAppear add self as observer:
You have to implement method on your main view controller that will do actual reloading,
this would be
make sure to remove yourself as a observer in viewWillDisappear
then you can post a notification from you popover controller