NSArray trough enumerateObjectsUsingBlock의 각 항목에 액세스하는 것을 삼가하고 있습니다. 빠른 열거 형을 사용하고 인덱스를 평가할 수 있기 때문입니다. Parse.com에 대한 경고 받기
내가 findObjectsInBackgroundWithBlock를 사용
,내가 경고를 얻을 : 장기 실행 작업은 메인 스레드에서 실행되고있다. 디버그하려면 warnBlockingOperationOnMainThread()를 중단하십시오.
메인 스레드를 차단하지 않기 위해 백그라운드에서 사용 된 것으로 생각됩니다. 여기에 내 코드 및 그 내가 그 쿼리에 대한 관계의 결과에서 이미지를 당기고있어 두 UIImageView 컨테이너 가지고 그 triying 해요. 단지 컨테이너 만 있었기 때문에 NSArray의 인덱스를 평가하는 것이 더 낫습니다.
경고를 어떻게 해결할 수 있는지 잘 모르겠습니다. 내 코드 문제 해결
덕분에
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (objects != 0) {
[objects enumerateObjectsUsingBlock:^(PFUser *object, NSUInteger idx, BOOL *stop) {
if (idx == 0) {
PFFile *userProfile = [object objectForKey:@"userPic"];
cell.promoter1.file = userProfile;
cell.promoter1.contentMode = UIViewContentModeScaleAspectFit;
[cell.promoter1 loadInBackground];
cell.promoter1Name.textAlignment = NSTextAlignmentCenter;
cell.promoter1Name.lineBreakMode = NSLineBreakByWordWrapping;
}
if (idx == 1) {
PFFile *userProfile = [object objectForKey:@"userPic"];
cell.promoter2.file = userProfile;
cell.promoter2.contentMode = UIViewContentModeScaleAspectFit;
[cell.promoter2 loadInBackground];
NSAttributedString *promoter1Name;
cell.promoter2Name.textAlignment = NSTextAlignmentCenter;
*stop = YES;
}
}];
}
}];