当我滚动时,我的tableview崩溃了

时间:2011-09-21 13:34:39

标签: xcode class global-variables

我不明白......我成功填充了我的表视图但是当我滚动它时没有消息崩溃..

我使用tabQuestion创建我的NSMutablearray,然后将其添加到我的代理中:cellForRowAtIndexPath

NSDictionary    *question = [self.tabQuestion objectAtIndex:indexPath.row];

[cell setAccessoryType: UITableViewCellAccessoryDisclosureIndicator];

cell.textLabel.text = [NSString stringWithFormat:@"%@", [question objectForKey:@"question"]];
cell.detailTextLabel.text =  [NSString stringWithFormat:@"%@", [question objectForKey:@"reponse"]];

if ([[question objectForKey:@"bOk"] isEqualToString:@"1"]) {
        cell.imageView.image = [UIImage imageNamed:@"ok.png"];
}
else
{
        cell.imageView.image = [UIImage imageNamed:@"ok.png"];   
}

[question release];



return cell;

1 个答案:

答案 0 :(得分:2)

您不应该releaseobjectAtIndex:的方法NSArray返回的[question release];个对象。这种情况非常罕见。

尝试首先删除所有行:self.tabQuestion

然后检查您的{{1}}是否包含必要数量的对象。

相关问题