只有20个上传的图像被带到列表视图

时间:2016-10-29 11:29:34

标签: ios objective-c

用户从设备库中上传图像,它们显示在用户照片(附件文件部分)中。列表未显示所有上传的图像。已上传图片的总数为42.但该列表仅限于显示其中的20个 我想我应该改变这里的逻辑。 感谢您的时间和回应。

- (void)showPatientImagesList {
    __weak BaseChartingController *weakSelf = self;
    [weakSelf showLoading:YES];
    [[RestClient sharedClient] callMethodByPath:METHOD_GET_PATIENT_FILES withHTTPMethodType:HTTP_GET withParameters:@{@"patientKey" : weakSelf.patientKey} callback:^(NSDictionary *responseDic, NSError *error) {
        [weakSelf showLoading:NO];
        if (SUCCEED_RESPONSE(responseDic, error)) {
            NSArray *images = [PatientAttachment arrayOfModelsFromDictionaries:[[responseDic objectForKey:@"data"] objectForKey:@"list"]];
            if (images.count) {
//                DLog(@"%@", responseDic);
                weakSelf.patientPhotos = [NSMutableArray arrayWithCapacity:0];
                for (PatientAttachment *patientAttachment in images) {
                    MWPhoto *photo = [MWPhoto photoWithURL:patientAttachment.photo.url];
                    photo.objectId = patientAttachment.photo.objectId;
                    photo.caption = patientAttachment.descrip;
//                    photo.caption = [NSString stringWithFormat:@"%@                %@: %@", patientAttachment.descrip, TRANSLATE(@"Upload date"),
//                                                               [[DateUtils sharedUtils] stringFromServerLongDate:patientAttachment.createdDate withFormat:SHORT_DATE_FORMAT]];
                    [weakSelf.patientPhotos addObject:photo];
                }
                MWPhotoBrowser *browser = [[MWPhotoBrowser alloc] initWithDelegate:weakSelf];
                browser.displayActionButton = NO;
                browser.displayDeleteBtn = [self.permissions containsObject:REMOVE_PATIENT_CHART_IMAGE_ATTACHMENT];
                browser.displayNavArrows = YES;
                browser.alwaysShowControls = NO;
                browser.zoomPhotosToFill = YES;
                browser.displaySelectionButtons = YES;

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
                browser.wantsFullScreenLayout = YES;
#endif
                browser.enableGrid = YES;
                browser.startOnGrid = YES;
                browser.enableSwipeToDismiss = YES;
                [browser setCurrentPhotoIndex:0];
                //                browser.thumbPhotos = photos;
                [weakSelf.selectedImages removeAllObjects];
                [weakSelf.navigationController pushViewController:browser animated:YES];
                weakSelf.searchParameters.start = @(weakSelf.patientPhotos.count);
            } else {
                ALERT(TRANSLATE(@"Patient has not images"));
            }

        } else {
            [[RestClient sharedClient] showErrorMessage:responseDic];
        }
    }];




}

0 个答案:

没有答案