0
当我尝试使用自定义TableCellView时,我的第一个IOS程序崩溃。在iOS中使用customcellview时发生崩溃
// 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 帽
日志终端有哪些错误?你可以发布堆栈跟踪吗?从上面的代码看起来好像 – 2011-06-03 09:42:44
哪一个是你的customcell的父类? UITableViewCell的? – itZme 2011-06-03 09:47:16
我打开NSZombieEnabled = YES 和控制台显示 *** - [CALayer的保留]:发送到释放实例 – Cap 2011-06-03 09:48:30