New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PINMemoryCache cost methods in PINCache #149
Conversation
…cept a cost argument.
@param cost An amount to add to the <memoryCache.totalCost>. | ||
@param block A block to be executed concurrently after the object has been stored, or nil. | ||
*/ | ||
- (void)setObject:(id)object forKey:(NSString *)key withCost:(NSUInteger)cost block:(nullable PINCacheObjectBlock)block; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
- (void)setObject:(id <NSCoding>)object forKey:(NSString *)key withCost:(NSUInteger)cost block:(nullable PINCacheObjectBlock)block;
? (adding the NSCoding protocol to object)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This was a copy/paste from PINMemoryCache
. I've pushed a correction now.
@param key A key to associate with the object. This string will be copied. | ||
@param cost An amount to add to the <memoryCache.totalCost>. | ||
*/ | ||
- (void)setObject:(nullable id)object forKey:(nullable NSString *)key withCost:(NSUInteger)cost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be:
- (void)setObject:(id <NSCoding>)object forKey:(NSString *)key withCost:(NSUInteger)cost;
(id shouldn't be nullable should be conforming to NSCoding and key shouldn't be nullable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This was a copy/paste from PINMemoryCache
. I've pushed a correction now.
Thank you for putting this up, much appreciated! Also appreciate new tests :) |
…uire NSCoding objects and non-null keys, consistent with rest of API.
Awesome, sorry this took so long to merge, really appreciate it! |
This PR addresses issue #64 to expose methods on
PINCache
that accept a memory cache cost argument.