iOS 3.0 类似 NSCache 的类
我目前正在编写一个将从缓存中受益匪浅的应用程序,我想使用 NSCache 类,它可以准确地提供我想要的内容(具有成本、键值对和自动清理的内存中缓存)。 但是,NSCache 仅适用于 iOS 4.0 及更高版本,但我也想以 iOS 3.0 为目标,因此我无法使用它(遗憾的是,不可以在旧设备上进行缓存)。
在开始编写自己的缓存类之前,我想知道是否有我可以使用的现有类(最好不是在 copy-left 许可证下)。
I'm currently writing a application that would benefit extremely from caching, I'd like to use the NSCache class which delivers exactly what I want (in-memory caching with cost, key-value pairs, and automatic cleaning).
However, NSCache is only available for iOS 4.0 and greater but I want to target iOS 3.0 too, so I can't use it (not caching on older devices is sadly not an option).
Before I start writing my own cache class, I want to know if there is an existing class that I could use (preferably not under an copy-left license).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来没有类可以做同样的事情,我在过去几个小时里在每个地方都查看了缓存类,但是我看到的所有内容都是磁盘缓存的类,这不是我想要的(我已经有一个磁盘缓存,但在记忆中什么也没有)。
长话短说,我决定为此编写自己的缓存类,我必须说它的效果出奇的好。
Looks like there is no class that can do the same, I looked the last hours at every place for a caching class, but everything I saw were classes for on disk caching which is not what I want (I have already an on disk cache, but nothing for in memory).
Long story short, I decided to write my own caching class for this and I must say that it works surprisingly well.