Skip to content

Instantly share code, notes, and snippets.

@rustle
Created May 14, 2013 19:02
Show Gist options
  • Save rustle/5578532 to your computer and use it in GitHub Desktop.
Save rustle/5578532 to your computer and use it in GitHub Desktop.
#pragma mark - Memory Cache Subscripting
// Allow self[key] for looking up and writing to memory cache
// This is mostly a novelty
- (id)objectForKeyedSubscript:(id)key
{
return [self.memoryCache objectForKey:key];
}
- (void)setObject:(id)obj forKeyedSubscript:(id)key
{
[self.memoryCache setObject:obj forKey:key];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment