title: UIDocumentInteractionController and file from web
body: <p>I want to open file from the web in other apps.</p>
  
  <p>My code:</p>
  
  <pre><code>NSURLRequest *req = [[NSURLRequest alloc] initWithURL:url];
  [NSURLConnection sendAsynchronousRequest:req queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *resp, NSData *respData, NSError *error){
      NSLog(@"resp data length: %i", respData.length);
      NSArray *names = [objDict[@"name"] componentsSeparatedByString:@"."];
      NSString *fileName = [@"downloaded." stringByAppendingString:names[names.count-1]];
      NSString * path = [NSTemporaryDirectory() stringByAppendingPathComponent:fileName];
      NSError *errorC = nil;
      BOOL success = [respData writeToFile:path 
                   options:NSDataWritingFileProtectionComplete
                     error:&amp;errorC];
  
      if (success) {
          UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
          documentController.delegate = self;
          [documentController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
      } else {
          NSLog(@"fail: %@", errorC.description);
      }
  }];
  </code></pre>
  
  <p>It shows panel, but crashes on click of any button (not 'Cancel' only).</p>
  
  <p>I enabled zombie objects and it writes:</p>
  
  <pre><code>-[UIDocumentInteractionController URL]: message sent to deallocated instance
  </code></pre>