2011-09-21 4 views
2

난 내가 만들 ... ... 난에 성공 내 테이블보기를 채울하지만 난 스크롤 할 때이 메시지없이 충돌내가 스크롤 내있는 tableview의 충돌이

을 알아 보았하지 않는 내 NSMutablearray 다음이 추가로 tabQuestion 내 대리자 : 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; 

답변

2

당신은 NSArray 방법 objectAtIndex:으로하지 release 객체 반환 된 것을. 아주 드물게 발생합니다.

시도는 모든 라인의 첫 번째 제거하는 방법 : 당신의 self.tabQuestion 개체의 필요한 양을 포함하는 경우

[question release]; 그런 다음 확인.

+0

이 줄만 추가하면 충돌이 발생합니다. -> NSLog (@ "% @ % i", [tabQuestion description], indexPath.row); NSLog (@ "% @", [[self.tabQuestion objectAtIndex : indexPath.row] description]); 인덱스 (15) 넘어 경계 (0) –

+0

오류는 배열에 0 개의 개체가 포함되어 있다고 표시합니다. – Nekto

+0

나는 해결책을 찾는다. 사실, 시스템은 자동으로 객체를 내 보냅니다. 나는 그것을 보유로 해결한다. –

관련 문제