JSON 파일에서 일부 이미지와 문자열을 구문 분석 할 때 구문 분석이 제대로 작동하지만 이미지로드가 매우 느립니다. 나는 UITableViewCell을 눌렀을 때 UITableView가 내용을 더 빠르게 보여 주었다. 누구든지 그 문제를 알고 있습니까?UITableViewCell 데이터로드 오류
내가 사용하는 코드는 다음과 같습니다. NSOperationQueue를 사용하여 CPU 사용량을 낮게 유지합니다.
NSDictionary *dict;
dict = [application objectAtIndex:indexPath.row];
name = [dict objectForKey:@"name"];
detileName = [dict objectForKey:@"detailName"];
itmsLink = [dict objectForKey:@"itms-serviceLink"];
icon = [dict objectForKey:@"icon"];
developer = [dict objectForKey:@"developer"];
version = [dict objectForKey:@"version"];
category = [dict objectForKey:@"category"];
rating = [dict objectForKey:@"rating"];
ratingNumbers = [dict objectForKey:@"ratingNumber"];
description = [dict objectForKey:@"description"];
developerEmails = [dict objectForKey:@"developerEmail"];
[downloadQueue addOperationWithBlock:^{
cell.AppName.text = name;
cell.category.text = category;
cell.rater.text = [NSString stringWithFormat:@"(%@)", ratingNumbers];
if ([rating intValue] == 1) {
cell.rating.image = [UIImage imageNamed:@"1.png"];
}
if ([rating intValue] == 2) {
cell.rating.image = [UIImage imageNamed:@"2.png"];
}
if ([rating intValue] == 3) {
cell.rating.image = [UIImage imageNamed:@"3.png"];
}
if ([rating intValue] == 4) {
cell.rating.image = [UIImage imageNamed:@"4.png"];
}
cell.itms = itmsLink;
cell.AppIcon.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:icon]]];
cell.number.text = [NSString stringWithFormat:@"%li", (long)indexPath.row + 1];
}];