오류 :"App Terminating"오류는 무엇입니까?
의한 캐치되지 않는 예외 'NSRangeException'응용 프로그램 종료, 이유* '* - [__ NSArrayM objectAtIndex :]의 경계를 넘어 인덱스 1 0 ... 0]
여기 내 코드는 :
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"AartiTableViewCell";
AartiTableViewCell *cell = (AartiTableViewCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AartiTableViewCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
cell.btnFav.userInteractionEnabled=YES;
}
NSString *strfavarry = [NSString stringWithFormat:@"SELECT Title FROM %@ WHERE identifire='%@'",[FavTablename objectAtIndex:indexPath.row],[FavIdent objectAtIndex:indexPath.row]];
FavTitle = [FavData lookupAllForSQL:strfavarry];
cell.selectionStyle=UITableViewCellSelectionStyleNone;
cell.index = indexPath.row;
cell.btnFav.tag=indexPath.row;
[cell.btnFav setBackgroundImage:[UIImage imageNamed:@"unfav.png"] forState:UIControlStateNormal];
[cell.btnFav addTarget:self action:@selector(handleFavouriteButton:) forControlEvents:UIControlEventTouchUpInside];
cell.lbltitle.text=[FavTitle objectAtIndex:indexPath.row];
return cell;
}
오류의 어떤 부분에 문제가 있습니까? 디버거에 문제가있는 정확한 위치가 표시됩니다. –
인덱스 1 초과 [0 .. 0] – seggy
FavTablename 및 FavIdent 배열을 채우는 위치는이 배열이 numberofrows 수보다 적을 수 있기 때문입니다. –