EWCacheManager Class Reference
Inherits from | NSObject |
Declared in | EWCacheManager.h |
Overview
The EWCacheManager
class provides a singleton cache manager with
convenience methods for downloading (via AFNetworking
) and interacting
with files stored in the app’s application support directory.
Instance Methods
deleteFileInCache:
Checks to see if a file exists in the cache, and if so, deletes it.
- (void)deleteFileInCache:(NSString *)filename
Parameters
- filename
The name of a cached file.
Declared In
EWCacheManager.h
downloadFileWithRequest:filename:success:failure:
Initiates a download request with the specified request and filename, executing success() and failure() as appropriate, if defined.
- (void)downloadFileWithRequest:(NSURLRequest *)request filename:(NSString *)filename success:(void ( ^ ) ( AFHTTPRequestOperation *operation , id responseObject ))success failure:(void ( ^ ) ( AFHTTPRequestOperation *operation , NSError *error ))failure
Parameters
- request
The URL request to make.
- filename
The filename where the data should be downloaded.
- success
The block to execute upon sucessfully downloading the requested file.
- failure
The block to execute upon failure (lost connection, data corruption, IO error, etc).
Declared In
EWCacheManager.h
hasFileInCache:
Returns a BOOL
representing a file’s presence in the cache.
- (BOOL)hasFileInCache:(NSString *)filename
Parameters
- filename
The name of a possibly cached file.
Return Value
YES
if the file is present, otherwise NO
.
Declared In
EWCacheManager.h
nameOfFileCurrentlyDownloading
Returns the name of the file currently being downloaded.
- (NSString *)nameOfFileCurrentlyDownloading
Return Value
The filename.
Declared In
EWCacheManager.h