我创建了自己的笔尖,并为它创建了类。我在界面构建器中将所有控件连接到类。当我运行它运行良好。唯一的问题是,当我sc着tableview它崩溃。任何想法的错误可能是什么?我一直试图解决这个问题一段时间无济于事。它给出了一个EXC_BAD_ACCESS,我不知道如何调试。Iphone SDK - 自定义UITableViewCell笔尖的烦恼
int cellType = [streamDataProvider cellTypeForIndex:indexPath.row];
if(cellType == HOP_GRAFITTI){
static NSString *CellIdentifier = @"HopGrafittiStreamCell";
HopGrafittiStreamCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"HopGrafittiStreamCell" owner:self options:nil];
cell = (HopGrafittiStreamCell *)[nib objectAtIndex:0];
[cell retain];
}
[cell.username setText: [streamDataProvider userNameForIndex:indexPath.row]];
[cell.venuename setText: [streamDataProvider venueNameForIndex:indexPath.row]];
[cell.grafittiText setText: [streamDataProvider grafittiForIndex:indexPath.row]];
return cell;
}
没关系 - 事实证明streamDataProvider有不是保留和被垃圾收集内部对象 – Fountainhop 2010-08-06 06:54:02
您可以用僵尸仪器仪表中调试这样的崩溃。 – 2010-08-06 07:45:35
垃圾收集? – taskinoor 2010-08-06 10:51:30