Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fancy caching with on-disk persistence

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 LICENSE
Octocat-spinner-32 Readme.markdown
Octocat-spinner-32 SYCache.h
Octocat-spinner-32 SYCache.m
Readme.markdown

SYCache

Simple in memory and on disk cache. It's backed by an NSCache in memory, so it automatically purges itself when memory gets low. Purged memory keys will automatically be loaded from disk the next time the are requested.

Usage

The API is simple.

- (id)objectForKey:(NSString *)key;
- (void)objectForKey:(NSString *)key usingBlock:(void (^)(id object))block;
- (void)setObject:(id)object forKey:(NSString *)key;

See SYCache.h for the full list of methods.

Adding to Your Project

Simply add SYCache.h and SYCache.m to your project.

ARC

If you are including SYCache in a project that uses Automatic Reference Counting (ARC) enabled, you will need to set the -fno-objc-arc compiler flag on all of the SYCache source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. In the "Compiler Flags" column, set -fno-objc-arc for each of the SYCache source files.

Something went wrong with that request. Please try again.