2
我不...已瞭解我成功地填充我的表視圖,但是當我把它的滾動崩潰而無消息..當我滾動我的tableview崩潰
創建我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;
如果我只添加這些行我有崩潰 - > NSLog(@「%@%i」,[tabQuestion description],indexPath.row); NSLog(@「%@」,[[self.tabQuestion objectAtIndex:indexPath.row] description]);索引(15)超出範圍(0) –
錯誤表示您的數組包含0個對象。 – Nekto
我找到解決方案。實際上,系統會自動釋放我的對象。我解決它與保留。 –