当我尝试使用自定义TableCellView时,我的第一个IOS程序崩溃。
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath {
AuthorizeTableCell *cell = (AuthorizeTableCell*) [tableView dequeueReusableCellWithIdentifier:@"AuthorizeCell"];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed: @"AuthorizeTableCell" owner:self options:nil] objectAtIndex:0 ];
}
cell.batchIDLabel.text = [[self.authorizeList objectAtIndex:indexPath.row] valueForKey:@"batchID"];
cell.amountIDLabel.text = [NSString stringWithFormat:@"%@", [[self.authorizeList objectAtIndex:indexPath.row] valueForKey:@"amount"]] ;
return cell;
}
AuthorizeTableCell类在TableCellView中只包含2个标签和1个按钮。我确保3级组件已在课堂上取消分配。如果我使用标准的TableCellView,程序运行正常。有人可以给我一些建议吗?
THX 帽
答案 0 :(得分:0)
很抱歉,我在自定义单元格dealloc中运行了错误的命令
-void dealloc {
[component1 dealloc];
[component2 dealloc];
[component3 dealloc];
[super dealloc];
}
我将其更改为'release'后,它可以正常工作^ _ ^ THX