diff --git a/EGOCache.h b/EGOCache.h index 03fca13..9f83a2a 100755 --- a/EGOCache.h +++ b/EGOCache.h @@ -84,5 +84,5 @@ - (void)setObject:(nonnull id)anObject forKey:(NSString* __nonnull)key; - (void)setObject:(nonnull id)anObject forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; -@property(nonatomic) NSTimeInterval defaultTimeoutInterval; // Default is 1 day -@end \ No newline at end of file +@property(nonatomic) NSTimeInterval defaultCacheTimeoutInterval; // Default is 1 day +@end diff --git a/EGOCache.m b/EGOCache.m index fb4f602..58adf24 100755 --- a/EGOCache.m +++ b/EGOCache.m @@ -119,7 +119,7 @@ - (instancetype)initWithCacheDirectory:(NSString*)cacheDirectory { [_cacheInfo removeObjectsForKeys:removedKeys]; self.frozenCacheInfo = _cacheInfo; - [self setDefaultTimeoutInterval:86400]; + [self setDefaultCacheTimeoutInterval:86400]; } return self; @@ -215,7 +215,7 @@ - (void)setCacheTimeoutInterval:(NSTimeInterval)timeoutInterval forKey:(NSString #pragma mark Copy file methods - (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key { - [self copyFilePath:filePath asKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self copyFilePath:filePath asKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { @@ -230,7 +230,7 @@ - (void)copyFilePath:(NSString*)filePath asKey:(NSString*)key withTimeoutInterva #pragma mark Data methods - (void)setData:(NSData*)data forKey:(NSString*)key { - [self setData:data forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setData:data forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setData:(NSData*)data forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { @@ -276,7 +276,7 @@ - (NSString*)stringForKey:(NSString*)key { } - (void)setString:(NSString*)aString forKey:(NSString*)key { - [self setString:aString forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setString:aString forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setString:(NSString*)aString forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { @@ -301,7 +301,7 @@ - (UIImage*)imageForKey:(NSString*)key { } - (void)setImage:(UIImage*)anImage forKey:(NSString*)key { - [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setImage:anImage forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setImage:(UIImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { @@ -321,7 +321,7 @@ - (NSImage*)imageForKey:(NSString*)key { } - (void)setImage:(NSImage*)anImage forKey:(NSString*)key { - [self setImage:anImage forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setImage:anImage forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setImage:(NSImage*)anImage forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval { @@ -339,7 +339,7 @@ - (NSData*)plistForKey:(NSString*)key; { } - (void)setPlist:(id)plistObject forKey:(NSString*)key; { - [self setPlist:plistObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setPlist:plistObject forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; { @@ -363,7 +363,7 @@ - (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTi } - (void)setObject:(id)anObject forKey:(NSString*)key { - [self setObject:anObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval]; + [self setObject:anObject forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval]; } - (void)setObject:(id)anObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {