Skip to content

Instantly share code, notes, and snippets.

@jamiepinkham
Last active December 17, 2015 08:18
Show Gist options
  • Save jamiepinkham/5578594 to your computer and use it in GitHub Desktop.
Save jamiepinkham/5578594 to your computer and use it in GitHub Desktop.
a subscripted cache
//
// JPSubscriptedCache.h
//
//
// Created by Jamie Pinkham on 5/14/13.
//
//
#import <UIKit/UIKit.h>
@interface JPSubscriptedCache : NSCache
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key;
@end
//
// JPSubscriptedCache.m
//
//
// Created by Jamie Pinkham on 5/14/13.
//
//
#import "JPSubscriptedCache.h"
@implementation JPSubscriptedCache
- (id)objectForKeyedSubscript:(id)key
{
[super objectForKey:key];
}
- (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key
{
[super setObject:obj forKey:key];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment