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

20170118

OFFLINE SYNC WILL SKIP PICTURES ON DEBUG.
Ray Zhang 9 лет назад
Родитель
Сommit
c2d3ac035b
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

+ 12 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -1641,10 +1641,21 @@ void UncaughtExceptionHandler(NSException *exception) {
         bool response = false;
         for (int i = 0;i<count;i++)
         {
-            NSDictionary* itemjson = [self.download_task objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+            NSMutableDictionary* itemjson = [[self.download_task objectForKey:[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
             NSString* url = [itemjson valueForKey:@"url"];
             NSString* type = [itemjson valueForKey:@"type"];
             
+            {
+                #ifdef DEBUG
+                //调试模式下跳过下载图片
+                if([type isEqualToString:@"img"])
+                {
+                    itemjson[@"status"]=@"finish";
+                    continue;
+                }
+                #endif
+            }
+            
             NSString* status = itemjson[@"status"];
             //bool finish = [[itemjson valueForKey:@"finish"] boolValue];
             if(! [status isEqualToString:@"finish"])