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
我找到解决方案。实际上,系统会自动释放我的对象。我解决它与保留。 –