First you need to present the resource (the downloaded file to open) using the NSURL object. The following assumes an NSString named filePath, which is already initialized with the path to the resource open .
NSURL *resourceToOpen = [NSURL fileURLWithPath:filePath];
, , .
BOOL canOpenResource = [[UIApplication sharedApplication] canOpenURL:resourceToOpen];
, , .
if (canOpenResource) { [[UIApplication sharedApplication] openURL:resourceToOpen]; }
UIApplication canOpenURL:
, openURL: . , URL- .
, , UTI , - -
UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
documentController.delegate = self;
[documentController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
UIDocumentInteractionControllerDelegate. UTI .