나는 실행할 때이 오류를주는 코드 블록이 있습니다. 그리고 나는 상대적으로 새로운데, 나는 문제를 해결할 수없는 것 같습니다.범위를 넘어 NSMutable 배열
오류 : 코어 애니메이션 : 무시 예외 : * - [NSMutableArray를 objectAtIndex :] 2011-09-06 12 : 31 : 06.094 ForceGauge [707 (266)]의 경계를 넘어 인덱스 1 0 ... 0]
-(void)peakCollector:(NSMutableArray *)testarray {
NSUInteger totalRows = [testarray count];
NSMutableArray *percentArray = [[NSMutableArray alloc]initWithObjects:0, nil];
if(forcecontroller.selectedSegmentIndex==0)
testarray = lbData;
else if(forcecontroller.selectedSegmentIndex==1)
testarray = kgData;
else if(forcecontroller.selectedSegmentIndex ==2)
testarray = ozData;
else if(forcecontroller.selectedSegmentIndex ==3)
testarray = newtonData;
for(int i = 0; i< totalRows-1; i++) {
if ([[testarray objectAtIndex:i+1] doubleValue] >= 1.2 * [[testarray objectAtIndex:i] doubleValue]) {
percentArray = [testarray objectAtIndex:i];
DatabaseTable *tableVC = [[DatabaseTable alloc] initWithStyle:UITableViewStylePlain];
[self.navigationController pushViewController:tableVC animated:YES];
if(forcecontroller.selectedSegmentIndex==0)
[tableVC copydatabase:percentArray];
else if(forcecontroller.selectedSegmentIndex==1)
[tableVC copydatabase:kgData];
else if(forcecontroller.selectedSegmentIndex==2)
[tableVC copydatabase:ozData];
else if(forcecontroller.selectedSegmentIndex==3)
[tableVC copydatabase:newtonData];
[tableVC release];
} else {
[analogData removeAllObjects];
}
}
}
'[[NSMutableArray alloc] initWithObjects : 0, nil];'. NSArray는 원시 타입이 아닌 객체 만 포함 할 수 있습니다. '[[NSMutableArray alloc] initWithObjects : [NSNumber numberWithInt : 0], nil]; ' – albertamg
@Bavarious는 여전히 같은 오류를줍니다. – ilaunchpad
@ila 문제가 어딘가에있는 것 같은 인상을 받았기 때문에 내 대답이 삭제되었습니다. 내가 작성한 (그리고 albertamg가 주석으로 게시 한) 것은 여전히 유효합니다. –