NSString *pictureUrl = [[[oneUserDict objectForKey:@"picture"]objectForKey:@"data"]objectForKey:@"url"];
[[AppEngine sharedEngine]imageAtURL:[NSURL URLWithString:pictureUrl] onCompletion:^(UIImage *fetchedImage, NSURL *url, BOOL isInCache)
{
int index = [usersArray indexOfObject:oneUserDict];
NSString *loadName = [NSString stringWithFormat:@"%d of %d",index,[usersArray count]];
NSLog(@"%i",usersArray.count);
int temp=[usersArray count]-10;
if (index!=temp)
{
[[LoadingIndicator currentIndicator]displayActivity:loadName];
NSLog(@"inside loading indicator");
}
else
{
[[LoadingIndicator currentIndicator]displayCompleted:@"Done"];
NSLog(@"finally done");
}
aPerson.image = UIImagePNGRepresentation(fetchedImage);
[appDelegate.managedObjectContext save:nil];
}];
AppEngine에 특정 URL에서 모든 이미지를 검색하고 및 aPerson에 저장되어 내가 현재하고있는 중이 야 imageAtURL:onCompletion:
MKNetworkKit는
라는 방법을 사용 MKNetworkEngine
의 서브 클래스 어떤 이미지를 검색하지 않습니다. 기본적으로 위의 코드는 FOR 루프에 있습니다 (예 : 사용자 수).
문제
결코 내가 왜 몰라하지만 난 블록 내부에 중단 점을 넣어했지만 여전히 컴파일러가 늘 완료 블록 내부의 문을 실행, 실행되지 도착 완료 블록에 위의 코드.
코드를 읽을 수 있도록 포맷 할 수 있습니까? 따라 오기가 어렵습니다 ... 미리 감사드립니다. –
@flexaddicted 내가 다시 코드를 포맷 했으니,이 감사를 통해 나를 도울 수 있다면 알려주세요. – vin
이미지 다운로드 요청을 시작하기 전에 NSLog (@ "% @", [NSURL URLWithString : pictureUrl]); 그들이 'nil'이 아닌지 확인하십시오. – Amar