diff --git a/EGOCache.h b/EGOCache.h index 05158cf..1b5778d 100755 --- a/EGOCache.h +++ b/EGOCache.h @@ -77,5 +77,7 @@ - (void)setObject:(id)anObject forKey:(NSString*)key; - (void)setObject:(id)anObject forKey:(NSString*)key withTimeoutInterval:(NSTimeInterval)timeoutInterval; +- (void)waitForDiskWrites; + @property(nonatomic,assign) NSTimeInterval defaultTimeoutInterval; // Default is 1 day @end \ No newline at end of file diff --git a/EGOCache.m b/EGOCache.m index 556c9ce..f2ce427 100755 --- a/EGOCache.m +++ b/EGOCache.m @@ -376,6 +376,14 @@ - (void)setObject:(id)anObject forKey:(NSString*)key withTimeoutInterv [self setData:[NSKeyedArchiver archivedDataWithRootObject:anObject] forKey:key withTimeoutInterval:timeoutInterval]; } +#pragma mark - +#pragma mark Synchronisation + +- (void)waitForDiskWrites +{ + dispatch_sync(_diskQueue,^{}); +} + #pragma mark - - (void)dealloc {