Эх сурвалжийг харах

1.修改上传列表滑动时清除UpdateUI。

Pen Li 9 жил өмнө
parent
commit
060d210e17

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


+ 1 - 1
RA Image/RA Image.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -6,7 +6,7 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "Yes"
+            shouldBeEnabled = "No"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "../common/upload/RANetworkTaskDelegate.m"

+ 8 - 8
RA Image/RA Image/Upload.storyboard

@@ -34,11 +34,11 @@
                                                 <rect key="frame" x="0.0" y="28" width="375" height="100"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="p1C-Cy-yXq" id="tdd-mO-6vJ">
-                                                    <rect key="frame" x="0.0" y="0.0" width="375" height="99.5"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="375" height="100"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="QS8884456999666666" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0VW-ZZ-YcB">
-                                                            <rect key="frame" x="10" y="5" width="647" height="20"/>
+                                                            <rect key="frame" x="10" y="5" width="355" height="20"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="20" id="bKP-Fo-NMF"/>
                                                             </constraints>
@@ -47,13 +47,13 @@
                                                             <nil key="highlightedColor"/>
                                                         </label>
                                                         <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="NYs-S2-H37">
-                                                            <rect key="frame" x="10" y="35" width="647" height="5"/>
+                                                            <rect key="frame" x="10" y="35" width="355" height="5"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="5" id="QYr-rE-zSp"/>
                                                             </constraints>
                                                         </progressView>
                                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99.9%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Qr-iv-UsW">
-                                                            <rect key="frame" x="607" y="45" width="50" height="21"/>
+                                                            <rect key="frame" x="315" y="45" width="50" height="21"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="21" id="8Tc-O3-69h"/>
                                                                 <constraint firstAttribute="width" constant="50" id="ljZ-ci-ehG"/>
@@ -63,13 +63,13 @@
                                                             <nil key="highlightedColor"/>
                                                         </label>
                                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DED-nv-Rm5">
-                                                            <rect key="frame" x="10" y="45" width="587" height="21"/>
+                                                            <rect key="frame" x="10" y="45" width="295" height="21"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                             <nil key="textColor"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
                                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Error:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AOp-qH-n4C">
-                                                            <rect key="frame" x="10" y="71" width="647" height="17"/>
+                                                            <rect key="frame" x="10" y="71" width="355" height="17"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                             <nil key="textColor"/>
                                                             <nil key="highlightedColor"/>
@@ -207,8 +207,8 @@
                                     <action selector="compressSwitchClick:" destination="rW7-Ba-NwZ" eventType="valueChanged" id="7It-Um-Jee"/>
                                 </connections>
                             </switch>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Should Compress Image" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="13k-tQ-BSv">
-                                <rect key="frame" x="16" y="180" width="187" height="20.5"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Compress Image" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="13k-tQ-BSv">
+                                <rect key="frame" x="16" y="180" width="129.5" height="20.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>

+ 12 - 6
RA Image/RA Image/UploadViewController.m

@@ -210,7 +210,7 @@
             
         };
         DebugLog(@"%@ set update ui",item_json[@"file"]);
-        cell.operation = op;
+//        cell.operation = op;
         //
         return cell;
     }
@@ -324,15 +324,21 @@
 
 - (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
     UploadCell *upCell = (UploadCell *)cell;
+//    if (upCell.operation) {
+//        upCell.operation.updateUI = nil;
+//    }
+    AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
+    NSUInteger row = indexPath.row;
+    NSUInteger count = Appdelegate.uploadManager.arr_queue.count;
+    if (count > row) {
+        NSDictionary * item_json = Appdelegate.uploadManager.arr_queue[indexPath.row];
+        RAUploadOperation* operation = item_json[@"operation"];
+        operation.updateUI = nil;
+    }
     upCell.name = nil;
     upCell.progress = 0;
     upCell.state = nil;
     upCell.errorMsg = nil;
-    if (upCell.operation) {
-        upCell.operation.updateUI = nil;
-    }
-
-    
 }
 
 /*