在表格单元格视图中显示 xml 解析数据时出现此语义问题。应用程序运行成功,但是当我选择任何行时,应用程序会进入详细视图,当时应用程序崩溃。请帮忙!!!
此行 的第三种情况出现语义问题
cell.textLabel.text = aBook.bookID;
应用代码:
- (UITableViewCell *)tableView:(UITableView *)tv 
         cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
  static NSString *CellIdentifier = @"Cell";
  UITableViewCell *cell = 
    [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                                   reuseIdentifier:CellIdentifier] autorelease];
  }
  switch (indexPath.section) {
    case 0:
      cell.textLabel.text = aBook.name;
      break;
    case 1:
      cell.textLabel.text = aBook.author;
      break;
    case 2:
      cell.textLabel.text = aBook.price;
      break;
    case 3:            
      cell.textLabel.text = aBook.bookID;
      break;
  }
  return cell;
}