崩溃时控制台打印信息:
CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no scheme
*** Assertion failure in -[UIDocumentInteractionController setURL:]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIDocumentInteractionController: invalid scheme (null). Only the file scheme is supported.'
代码如下:
![](https://img.haomeiwen.com/i2995184/c93913d18447778f.png)
解决办法:路径String转URL的时候使用fileURLWithPath:方法。
![](https://img.haomeiwen.com/i2995184/f2c0b3e9fea98325.png)
也可参考:
ios - UIDocumentInteractionController "invalid scheme (null)" - Stack Overflow
网友评论