Marino Faggiana 7 жил өмнө
parent
commit
04dfbc515f

+ 9 - 4
iOSClient/ManageLocation+ManageAsset/NCRequestAsset.m

@@ -30,15 +30,17 @@
         return;
         return;
     }
     }
 
 
-    PHAsset *asset = result[0];
-    PHAssetMediaType assetMediaType = asset.mediaType;
-    __block NSError *error = nil;
+    PHAsset *assetResult = result[0];
+    PHAssetMediaType assetMediaType = assetResult.mediaType;
     
     
     // VIDEO
     // VIDEO
     if (assetMediaType == PHAssetMediaTypeVideo) {
     if (assetMediaType == PHAssetMediaTypeVideo) {
 
 
         @autoreleasepool {
         @autoreleasepool {
-            
+        
+            __block PHAsset *asset = result[0];
+            __block NSError *error = nil;
+
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
 
 
             PHVideoRequestOptions *options = [PHVideoRequestOptions new];
             PHVideoRequestOptions *options = [PHVideoRequestOptions new];
@@ -122,6 +124,9 @@
         
         
         @autoreleasepool {
         @autoreleasepool {
             
             
+            __block PHAsset *asset = result[0];
+            __block NSError *error = nil;
+        
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
             dispatch_semaphore_t semaphoreGroup = dispatch_semaphore_create(0);
             
             
             PHImageRequestOptions *options = [PHImageRequestOptions new];
             PHImageRequestOptions *options = [PHImageRequestOptions new];