嗨,我的应用程序在滚动 tableview 时崩溃,并使用 LowMemory 维护崩溃日志名称。谁能告诉我我该如何管理这个。我使用的代码在这里:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NSLog(@" %i",indexPath.section);
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//cell=nil;
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
UIImageView *cellBg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 768, 90)];
cellBg.image=[UIImage imageNamed:@"Cellbg.png"];
[cell addSubview:cellBg];
UILabel *lblRecipeBorder=[[UILabel alloc]initWithFrame:CGRectMake(105, 5, 640, 80)];
lblRecipeBorder.backgroundColor=[UIColor blackColor];
lblRecipeBorder.layer.borderWidth=5.0;
lblRecipeBorder.layer.cornerRadius=8.0;
lblRecipeBorder.layer.borderColor=[[UIColor darkGrayColor] CGColor];
[cell addSubview:lblRecipeBorder];
UIImageView *RecipeeImg=[[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 100, 80)];
RecipeeImg.backgroundColor=[UIColor clearColor];
RecipeeImg.layer.borderWidth=5.0;
RecipeeImg.layer.cornerRadius=8.0;
RecipeeImg.layer.borderColor=[[UIColor darkGrayColor] CGColor];
RecipeeImg.image=[UIImage imageNamed:[[appdelegate.arrFiderTool objectAtIndex:indexPath.row] objectForKey:@"RecipestepPics"]];
RecipeeImg.layer.masksToBounds = YES;
[cell addSubview:RecipeeImg];
UILabel *lblRecipee=[[UILabel alloc]initWithFrame:CGRectMake(140, 10, 620, 70)];
lblRecipee.backgroundColor=[UIColor clearColor];
[lblRecipee setNumberOfLines:2];
lblRecipee.textColor=[UIColor colorWithRed:255.0/255.0 green:52.0/255.0 blue:179.0/255.0 alpha:1.0];
//lblRecipee.font=[UIFont boldSystemFontOfSize:18.0];
lblRecipee.font=[UIFont fontWithName:@"Noteworthy-Bold" size:18.0];
//[lblMeetingId setFont:[UIFont fontWithName:@"Times New Roman" size:14]];
lblRecipee.text=[[appdelegate.arrFiderTool objectAtIndex:indexPath.row] objectForKey:@"RecipeName"];
[cell addSubview:lblRecipee];
[RecipeeImg release];
[lblRecipee release];
[cellBg release];
[lblRecipeBorder release];
// }
cell.selectionStyle=UITableViewCellSelectionStyleNone;
return cell;
}