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

Add copy DB on Documents for DEBUG mode

Marino Faggiana 7 лет назад
Родитель
Сommit
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;