Signal "0" error usually means that application crashed because of low memory.
It seems that your problem is the following - you create cell subviews and add them to your cell each time cellForRowAtIndexPath
method gets called - so all your allocated UI elements hang in memory and application gets out of it eventually.
To solve your problem you must create cell's subviews only once - when creating it and later just setup their contents:
- (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];
UIImageView *photoTag = [[UIImageView alloc] initWithFrame:CGRectMake(5.0, 5.0, 85.0, 85.0)];
photoTag.tag = 10;
[cell.contentView addSubview:photoTag];
[photoTag release];
UILabel *labelImageCaption = [[UILabel alloc] initWithFrame:CGRectMake(110.0, 15.0, 190.0, 50.0)];
labelImageCaption.tag = 11;
labelImageCaption.textAlignment = UITextAlignmentLeft;
[cell.contentView addSubview:labelImageCaption];
[labelImageCaption release];
}
//Photo ImageView
NSString *rowPath =[[imagePathsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
UIImageView* photoTag = (UIImageView*)[cell.contentView viewWithTag:10];
photoTag.image = [UIImage imageWithContentsOfFile:rowPath];
// Image Caption
UILabel *labelImageCaption = (UILabel*)[cell.contentView viewWithTag:11];
NSString *imageCaptionText =[ [imageCaptionsDictionary valueForKey:[summaryTableViewDataArray objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
labelImageCaption.text = imageCaptionText;
return cell;
}
Vladimir
2010-04-09 12:42:20