0
테이블 뷰에서 이미지를 스크롤하는 동안 문제가 있습니다.이미지가있는 테이블 뷰를 스크롤하는 동안 신호 "0"오류가 발생했습니다.
신호 "0"오류가 발생했습니다.
나는 그것이 일부 메모리 문제로 인한 것이라고 생각하지만 정확한 오류를 찾을 수는 없습니다. 다음과 같이 코드는
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [travelSummeryPhotosTable dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
}
//Photo ImageView
UIImageView *photoTag = [[UIImageView alloc] initWithFrame:CGRectMake(5.0, 5.0, 85.0, 85.0)];
NSString *rowPath =[[imagePathsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
photoTag.image = [UIImage imageWithContentsOfFile:rowPath];
[cell.contentView addSubview:photoTag];
[photoTag release];
// Image Caption
UILabel *labelImageCaption = [[UILabel alloc] initWithFrame:CGRectMake(110.0, 15.0, 190.0, 50.0)];
labelImageCaption.textAlignment = UITextAlignmentLeft;
NSString *imageCaptionText =[ [imageCaptionsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
labelImageCaption.text = imageCaptionText;
[cell.contentView addSubview:labelImageCaption];
[labelImageCaption release];
return cell;
}
감사합니다 사전에있다.
감사 블라디미르! : 나중에 단지 설정 내용을을 만들 때 -
한 번만 세포의 서브 뷰를 작성해야 문제를 해결하기 위해 코드를 업데이트했습니다. 응용 프로그램이 충돌하지 않지만 TableView의 스크롤이 매우 느립니다. 런타임에 문서 디렉토리에서 이미지를로드하고 있습니다. 느린 스크롤링의 이유입니까? 이미지를 저장하는 표준 방법은 무엇입니까? 이미지 배열을 만들고 액세스해야합니까? 이미지의 크기 또한 스크롤 속도에 영향을 줍니까? 다른 클래스의 메모리 누수로 인해 느린 스크롤이 발생합니까? –
에서 Apple의 LazyTableImages 샘플을 확인하십시오. http://developer.apple.com/iphone/library/samplecode/LazyTableImages/Introduction/Intro.html – Vladimir