Swift3.0 文件写入时 no scheme

2017-06-05  本文已影响551人  知忧丶

前言

在使用Swift进行文件读取时系统输出错误: CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no scheme. Error Domain=NSCocoaErrorDomain Code=518 "The file couldn’t be saved because the specified URL type isn’t supported."

原因

查看相关源文件

Data
url必须是一个本地位置,所以需要使用本地文件传输协议File Protocol

解决

参考链接

CFURLCopyResourcePropertyForKey failed because passed URL no scheme

上一篇 下一篇

猜你喜欢

热点阅读