DDGDataCache_Swift
DDGDataCache_Swift copied to clipboard
创建缓存文件失败
环境swift5 + xcode13.1 + macos 11.6.1 代码
DDGDataCache.save_asyncJsonResponseToCacheFile(json.dictionaryObject as AnyObject, URL: url, path: path, subPath: subpath) { succ in
if succ {
print("day weather 保存成功")
} else {
print("day weather 保存失败")
}
}
报错 create cache directory failed, error = %@ Error Domain=NSCocoaErrorDomain Code=642 "You can’t save the file “dayWeather” because the volume “Macintosh HD - 数据” is read only." UserInfo={NSFilePath=/dayWeather, NSUnderlyingError=0x6000031eff60 {Error Domain=NSPOSIXErrorDomain Code=30 "Read-only file system"}}