NSInteger -> NSUInteger, add getter method

This commit is contained in:
Joshua Gross 2013-11-22 16:38:18 -08:00
parent c7f2665d05
commit c3ee589681
2 changed files with 7 additions and 2 deletions

View File

@ -35,7 +35,7 @@ typedef enum SDImageCacheType SDImageCacheType;
/**
* The maximum "total cost" of the in-memory image cache. The cost function is the number of pixels held in memory.
*/
@property (assign, nonatomic) NSInteger maxMemoryCost;
@property (assign, nonatomic) NSUInteger maxMemoryCost;
/**
* The maximum length of time to keep an image in the cache, in seconds

View File

@ -338,11 +338,16 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
}
}
- (void)setMaxMemoryCost:(NSInteger)maxMemoryCost
- (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost
{
self.memCache.totalCostLimit = maxMemoryCost;
}
- (NSUInteger)maxMemoryCost
{
return self.memCache.totalCostLimit;
}
- (void)clearMemory
{
[self.memCache removeAllObjects];