RMCacheObject Class Reference
Inherits from | NSObject |
Declared in | RMCacheObject.h |
Overview
An RMCacheObject is a representation of a tile cache for use with the RMMemoryCache in-memory cache storage. While RMDatabaseCache uses a disk-based database backing store, RMMemoryCache maintains first-class objects in memory for use later.
Tasks
Managing Cache Objects
-
cachedObject
property -
cacheKey
property -
tile
property -
timestamp
property -
+ cacheObject:forTile:withCacheKey:
-
– initWithObject:forTile:withCacheKey:
-
– touch
Properties
cacheKey
The unique identifier for the cache.
@property (nonatomic, readonly) NSString *cacheKey
Discussion
The unique identifier for the cache.
Declared In
RMCacheObject.h
cachedObject
The object to be cached, typically a UIImage.
@property (nonatomic, readonly) id cachedObject
Discussion
The object to be cached, typically a UIImage.
Declared In
RMCacheObject.h
Class Methods
cacheObject:forTile:withCacheKey:
Creates and returns a cache object for a given key and object to store in a given cache.
+ (instancetype)cacheObject:(id)anObject forTile:(RMTile)aTile withCacheKey:(NSString *)aCacheKey
Parameters
- anObject
The object to cache, typically a UIImage.
- aTile
The tile key for the object.
- aCacheKey
The unique identifier for the cache.
Return Value
A newly created cache object.
Discussion
Creates and returns a cache object for a given key and object to store in a given cache.
Declared In
RMCacheObject.h
Instance Methods
initWithObject:forTile:withCacheKey:
Initializes and returns a newly allocated cache object for a given key and object to store in a given cache.
- (id)initWithObject:(id)anObject forTile:(RMTile)tile withCacheKey:(NSString *)aCacheKey
Parameters
- anObject
The object to cache, typically a UIImage.
- tile
The tile key for the object.
- aCacheKey
The unique identifier for the cache.
Return Value
An initialized cache object.
Discussion
Initializes and returns a newly allocated cache object for a given key and object to store in a given cache.
Declared In
RMCacheObject.h
touch
Updates the timestamp on a cache object to indicate freshness. Objects with older timestamps get deleted first when space is needed.
- (void)touch
Discussion
Updates the timestamp on a cache object to indicate freshness. Objects with older timestamps get deleted first when space is needed.
Declared In
RMCacheObject.h