Skip to content

[[KNCache shareCache] saveData:data forKey:stringValue];

License

Notifications You must be signed in to change notification settings

Mfk759853063/DataCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##DataCache? 一个缓存类,支持缓存自定义对象

##如何使用?

NSData *data = [NSData dataWithContentsOfFile:filePath];
for (int i = 0; i< 1000; i++) {
    [[KNCache shareCache] saveData:data forKey:@(i).stringValue];
}
[[KNCache shareCache] getSizeWithCompletionBlock:^(id data) {
    NSLog(@"data %@",data);
}];
[[KNCache shareCache] clearDataWithCompletionBlock:nil];

##参考SDImageCache的做法,感谢@SDImageCache

About

[[KNCache shareCache] saveData:data forKey:stringValue];

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published