Просмотр исходного кода

1.修复RA Image移动照片失败。

Pen Li 9 лет назад
Родитель
Сommit
9abc178bee

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 8 - 1
RA Image/RA Image/BasicModeViewController.m

@@ -364,7 +364,14 @@
     NSString *cachePath = [NSString stringWithFormat:@"%@/%@/%@",[RAUtils appCacheDirectory],self.name,img];
     
     NSFileManager *fileManager = [NSFileManager defaultManager];
-    [fileManager moveItemAtPath:tmpPath toPath:cachePath error:nil];
+    [fileManager createDirectoryAtPath:[cachePath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil];
+    NSError *err;
+    BOOL res = [fileManager moveItemAtPath:tmpPath toPath:cachePath error:&err];
+    if (res) {
+        DebugLog(@"move tmp to cache");
+    } else {
+        DebugLog(@"move tmp to cache failed %@",err);
+    }
 }
 
 #pragma mark - Image Picker Button Action