gaosboy / kache Goto Github PK
View Code? Open in Web Editor NEWiOS缓存控件,支持哈希,队列和时间池
License: MIT License
iOS缓存控件,支持哈希,队列和时间池
License: MIT License
如题,提高效率,多线程处理
Kache有单例对象,使用GCD方式获取单例
把归档操作放到另外的线程中,保证主线程的操作流畅
同时注意并发的竞争问题
你好,我刚刚大致浏览了一下这个项目,我感觉可以更少的用宏定义。
*** -[NSArray initWithArray:range:copyItems:]: range {0, 2} extends beyond bounds 0 .. 0
(
0 CoreFoundation 0x37c1e8d7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x3776a1e5 objc_exception_throw + 32
2 CoreFoundation 0x37b7829b -[NSArray initWithArray:range:copyItems:] + 450
3 CoreFoundation 0x37b8c2b9 -[NSArray mutableCopyWithZone:] + 84
4 shoot 0x100645 __22-[KHolder archiveData]_block_invoke + 292
5 libdispatch.dylib 0x307d7d55 _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x307da897 _dispatch_worker_thread2 + 258
7 libsystem_c.dylib 0x376dd1cf _pthread_wqthread + 294
8 libsystem_c.dylib 0x376dd0a4 start_wqthread + 8
)
*** -[NSArray initWithArray:range:copyItems:]: range {0, 3} extends beyond bounds [0 .. 1]
(null)
(
0 CoreFoundation 0x354d68a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x3787d259 objc_exception_throw + 32
2 CoreFoundation 0x35430263 -[NSArray initWithArray:range:copyItems:] + 450
3 CoreFoundation 0x35444289 -[NSArray mutableCopyWithZone:] + 84
4 shoot 0x100645 __22-[KHolder archiveData]_block_invoke + 292
5 libdispatch.dylib 0x34363c59 _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x34366817 _dispatch_worker_thread2 + 258
7 libsystem_c.dylib 0x32893dfb _pthread_wqthread + 294
8 libsystem_c.dylib 0x32893cd0 start_wqthread + 8
)
rt
Kache支持一些放到NSArray里面的自定义对象么?好多情况下会有这样的情况~
我在一个需要缓存数据的页面对数据进行了缓存:
[Kache setValue: inDefaultPoolForKey: expiredAfter:];用的这个方法。
然后在appdelegate里面添加了如下代码:
KHolder类中的objectForKey方法,每次取出缓存数据之后,都立即将已保存在本地的文件删除,所以造成当离线使用时,第一次能看到数据,之后就再也看不到了。这点让人觉得很奇怪,不是应该等过期了再删除吗?
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.