0
UIDocumentInteractionController *documentVc = [UIDocumentInteractionController interactionControllerWithURL:fileURL];

documentVc.delegate = self;

if (![documentVc respondsToSelector:@selector(presentPreviewAnimated:)]) {
     NSLog(@"can not open this file");
} else {
    [documentVc presentPreviewAnimated:YES];
}

when UIDocumentInteractionController can not open a file, I want to know how to tip user, that file can not be open. any idea?

and my code is not working.

lyqflnh
  • 21
  • 3

1 Answers1

0

[documentVc presentPreviewAnimated:YES]

this method has a return value to indicate whether a file was able to display.

lyqflnh
  • 21
  • 3