美文网首页iOS开发知识小集
iOS UIDocumentInteractionControl

iOS UIDocumentInteractionControl

作者: Accepted_ | 来源:发表于2019-04-25 11:54 被阅读28次

崩溃时控制台打印信息:

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.'


代码如下:

导致崩溃的写法

解决办法:路径String转URL的时候使用fileURLWithPath:方法。

正确写法

也可参考:

ios - UIDocumentInteractionController "invalid scheme (null)" - Stack Overflow

相关文章

网友评论

    本文标题:iOS UIDocumentInteractionControl

    本文链接:https://www.haomeiwen.com/subject/aovagqtx.html