title: Calling method from another class, uiwebview and modal view issues
body: <p>I'm experiencing a few issues when trying to call a method from another class.  Here's my code</p>
  
  <p>Appdelegate.m</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
  
  if ([url isFileURL]){
         RootViewController *theview = [[RootViewController alloc] init];
         [theview handleOpenURL:url];
         }
         return YES;
    }
  </code></pre>
  
  <p>RootViewController.h</p>
  
  <pre><code> @interface RootViewController : UIViewController &lt;UIWebViewDelegate&gt;{
       IBOutlet UIWebView* mainwebView;
    }
  - (void)handleOpenURL:(NSURL *)url;
  @property (nonatomic, retain) UIWebView* mainWebView;
  </code></pre>
  
  <p>RootViewController.m</p>
  
  <pre><code>- (void)handleOpenURL:(NSURL *)url{
  
  NSLog(@"Method handleOpenURL completed")
  
  [mainwebView setDelegate:self];
  [self.mainwebView loadRequest:[[NSurLRequest alloc] initWithURL:url];
  
  
  
  [self performSelector:@selector(handleIt) withObject:nil afterDelay:3.0];
  }
  
  - (void)handleIt{
  docView *docController = [[docView alloc] initWithNibName:nil bundle:nil];
  [self presentModalViewController:docController animated:YES];
  }
  </code></pre>
  
  <p>So, basically I'm trying to update a UIWebView and then present a modal view controller once the appdelegate calls handleOpenURL.  The problem is that both of these things (updating webview and presenting view controller) refuse to work in the method handleOpenURL.  They work perfectly fine in viewdidload, which makes me think it has something to do with the method being called from appdelegate.</p>
  
  <p>The webview simply refuses to respond when accessed from the handleOpenURL method, and when I present the modal view controller I get the error </p>
  
  <pre><code> Warning: Attempt to present ... whose view is not in the window hierarchy!
  </code></pre>
  
  <p>But, again the modalview works fine when presented from viewdidload (using the time delay selector)</p>
  
  <p>An explanation to why this is happening or a workaround would be great, thanks for your help.</p>