|
@@ -862,6 +862,32 @@ begin:
|
|
|
// return CGRectMake(x, y, v.frame.size.width, v.frame.size.height);
|
|
// return CGRectMake(x, y, v.frame.size.width, v.frame.size.height);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
++ (void)saveData:(NSData *)data toPath:(NSString *)path {
|
|
|
|
|
+// NSString *directory = [path stringByDeletingLastPathComponent];
|
|
|
|
|
+ NSFileManager *manager = [NSFileManager defaultManager];
|
|
|
|
|
+ NSString *dir = [path stringByDeletingLastPathComponent];
|
|
|
|
|
+ BOOL create = [manager createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil];
|
|
|
|
|
+ if (create) {
|
|
|
|
|
+ BOOL save = [manager createFileAtPath:path contents:data attributes:nil];
|
|
|
|
|
+ if (save) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
++ (void)removeFileAtPath:(NSString *)path {
|
|
|
|
|
+ if (!path.length) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ NSFileManager *manager = [NSFileManager defaultManager];
|
|
|
|
|
+ [manager removeItemAtPath:path error:nil];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
++ (NSString *)appCacheDirectory {
|
|
|
|
|
+ return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|