TumblrArchive / TMCache

Fast parallel object cache for iOS and OS X.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TMDiskCache's enumerateObjectsWithBlock doesn't return objects

iwasrobbed opened this issue · comments

In the implementation for enumerateObjectsWithBlock:completionBlock:, the expanded TMDiskCacheObjectBlock is explicitly returning nil when enumerating over the keys, so effectively this enumerateObjects.. method is just for returning keys and file URLs, but no objects.

for (NSString *key in keysSortedByDate) {
    NSURL *fileURL = [strongSelf encodedFileURLForKey:key];
    // Where block arguments are: 
    // TMDiskCache *cache, NSString *key, id <NSCoding> object, NSURL *fileURL
    block(strongSelf, key, nil, fileURL);
}

Is there a reason for doing this or should this enumeration method be renamed if it was intended to only be used for keys?

Hmm, this seems odd, however TMCache is no longer in active maintenance, please see here for an alternative to satisfy your needs.