浏览代码

Add copy DB on Documents for DEBUG mode

Marino Faggiana 7 年之前
父节点
当前提交
e9fe5d17f2
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      iOSClient/AppDelegate.m

+ 6 - 0
iOSClient/AppDelegate.m

@@ -147,6 +147,12 @@
         }
     }
     
+#ifdef DEBUG
+    NSString *atPathDB = [NSString stringWithFormat:@"%@/nextcloud.realm", [[dirGroup URLByAppendingPathComponent:appDatabaseNextcloud] path]];
+    NSString *toPathDB = [NSString stringWithFormat:@"%@/nextcloud.realm", [CCUtility getDirectoryLocal]];
+    [[NSFileManager defaultManager] copyItemAtPath:atPathDB toPath:toPathDB error:nil];
+#endif
+    
     // Operation Queue OC Networking
     _netQueue = [[NSOperationQueue alloc] init];
     _netQueue.name = k_queue;