Code Monkey home page Code Monkey logo

cachekit's Introduction

CacheKit

CI Status Version Carthage compatible License Platform

For a more Swift focused caching solution, check out PersistentCacheKit, which is the spiritual successor to this project.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CocoaPods

CacheKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CacheKit"

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate CacheKit into your Xcode project using Carthage, specify it in your Cartfile:

github "davbeck/CacheKit" ~> 0.6

Run carthage to build the framework and drag the built CacheKit.framework and FMDB.framework into your Xcode project.

Author

David Beck, [email protected]

License

CacheKit is available under the MIT license. See the LICENSE file for more info.

cachekit's People

Contributors

davbeck avatar readmecritic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cachekit's Issues

nsuserdefaults memory

can you please add another type of storing the nsuserdefaults so we can get benefit from the expire feature it will be great thank you

Memory cache crash

- (id)objectForKey:(NSString *)key expires:(NSDate *)expires withContent:(id(^)())content
{
    CKCacheContent *cacheContent = [self objectInMemoryForKey:key];

    if (cacheContent == nil && content != nil) {
        id object = content();
        if (object != nil) {
            cacheContent = [CKCacheContent cacheContentWithObject:object expires:expires];
            [_internalCache setObject:cacheContent forKey:key];
        }
    }

    return cacheContent.object;
}

- (id)objectInMemoryForKey:(NSString *)key
{
    CKCacheContent *cacheContent = [_internalCache objectForKey:key];

    if (cacheContent.expires.timeIntervalSinceNow < 0.0) {
        [_internalCache removeObjectForKey:key];
        cacheContent = nil;
    }

    return cacheContent.object;
}

When I try to extract value from the cache it gives crash because inside - (id)objectInMemoryForKey:(NSString *)key you return id object and then in - (id)objectForKey:(NSString *)key expires:(NSDate *)expires withContent:(id(^)())content use it like CKCacheContent.

CKCache is implemented in ChatKit.framework

Class CKCache is implemented in both /System/Library/PrivateFrameworks/ChatKit.framework/ChatKit (0x1e3d0ad18) and /var/containers/Bundle/Application/xxx. One of the two will be used. Which one is undefined.

Encrypted Cache

could you plz add a feature , that we can encrypt/decrypt the content cache by key
whenever type we choose, SQL/FILE...

Get a fmdb warning for not closing FMResultSet

Looks like this:
Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]

Adding a [s close] in

  • (id)objectForKey:(NSString *)key expires:(NSDate *)expires withContent:(id(^)())content
    seems to solve it.

get all cached object

how i can get all cached object in a specific cache type,
its will be an excellent feature to add

nsmutablearray dosnt store all its info

i store nsmustablearray the contain nsstring and custom view , ,
when i store it using the memory concept it store good, but when i stor it view SQLITE or FIle, the custom view attribue returning nill,
is ther any way to serialise/desiralise or some workarround to store it correctly,
please help,
THankyou

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.