Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions EGOCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@
- (void)setObject:(nonnull id<NSCoding>)anObject forKey:(NSString* __nonnull)key;
- (void)setObject:(nonnull id<NSCoding>)anObject forKey:(NSString* __nonnull)key withTimeoutInterval:(NSTimeInterval)timeoutInterval;

@property(nonatomic) NSTimeInterval defaultTimeoutInterval; // Default is 1 day
@end
@property(nonatomic) NSTimeInterval defaultCacheTimeoutInterval; // Default is 1 day
@end
16 changes: 8 additions & 8 deletions EGOCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (instancetype)initWithCacheDirectory:(NSString*)cacheDirectory {

[_cacheInfo removeObjectsForKeys:removedKeys];
self.frozenCacheInfo = _cacheInfo;
[self setDefaultTimeoutInterval:86400];
[self setDefaultCacheTimeoutInterval:86400];
}

return self;
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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; {
Expand All @@ -363,7 +363,7 @@ - (void)setPlist:(id)plistObject forKey:(NSString*)key withTimeoutInterval:(NSTi
}

- (void)setObject:(id<NSCoding>)anObject forKey:(NSString*)key {
[self setObject:anObject forKey:key withTimeoutInterval:self.defaultTimeoutInterval];
[self setObject:anObject forKey:key withTimeoutInterval:self.defaultCacheTimeoutInterval];
}

- (void)setObject:(id<NSCoding>)anObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval {
Expand Down