dudongge / ddgdatacache_swift Goto Github PK
View Code? Open in Web Editor NEW一句代码就可为你的数据添加一级和二级目录缓存,支持单独删除指定文件下的文件
License: MIT License
一句代码就可为你的数据添加一级和二级目录缓存,支持单独删除指定文件下的文件
License: MIT License
环境:swift5 模拟器6s iOS9
操作:未经过存储,直接调用获取缓存大小 DDGDataCache.cacheAllSize()
错误日志:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager fileSystemRepresentationWithPath:]: nil or empty path argument'
环境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"}}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.