I want to load a PDF file in a modal view controller.
Since the moment that I don't know the size of the file, I want to load it on a separate thread, so:

```
- (void)viewDidLoad {
  [super viewDidLoad];
  [[UISharedApplication sharedApplication] setNetworkActivityIndicatorVisibile:YES];
  [NSThread detachNewThreadSelector:@selector(loadPDF) toTarget:self withObject:nil];
}
- (void)loadPDF {
  NSAutoreleasePool *threadPool = [[NSAutoreleasePool alloc] init];

  [self.webView loadRequest:[NSURLRequest requestWithURL:url]];

  [threadPool release];

  [self performSelectorOnMainThread:@selector(showPDF) withObject:nil waitUntilDone:NO];
}
- (void)showPDF {
  [self.webView setHidden:NO];
  [self.spinner stopAnimating];
  [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}

```

The method works pretty good in other files (at least I guess) where I parse some XML data, but here doesn't. Commenting:

```
[self performSelectorOnMainThread:@selector(showPDF) withObject:nil waitUntilDone:NO];

```

lets me to see the spinner and the activity indicator on the top. So I think that:

```
[self.webView loadRequest:[NSURLRequest requestWithURL:url]];

```

doesn't wait until finish and gives the control back to the caller. How can I fix it?