Signal "0" error while scrolling a tableview with images
Posted
by Amitkumar
on Stack Overflow
See other posts from Stack Overflow
or by Amitkumar
Published on 2010-04-09T12:30:55Z
Indexed on
2010/04/09
12:33 UTC
Read the original article
Hit count: 366
Hi,
I have a problem while scrolling images on tableview. I am getting a Signal "0" error. I think it is due to some memory issues but I am not able to find out the exact error. The code is as follows,
- (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;
}
Thanks in advance.
© Stack Overflow or respective owner