Thread1: EXE_BAD_INSTRUTION. How does this error show up, I just removed some line that are not important?

I have a button that starts tests. The items, test no, min and max are added to the table_array and refresh table to show them.

Following code runs without error.

index++;
    //if([[Elect objectAtIndex:index]isEqualToString:@"1"])
    
        item++;
        temp = [self GetDCVoltage_34970:1];
        if(temp >= [[Min objectAtIndex:index]floatValue] && temp <= [[Max objectAtIndex:index]floatValue])
            [table_status addObject:@"Pass"];
        else
        {
            PF=false; [table_status addObject:@"Fail"];
            err=101+item; [errcode setIntValue:err];
        }
        
        [table_no addObject:[NSString stringWithFormat:@"%d",item]];
        [self Show_Datagrid:index];
        [table_value addObject:[NSString stringWithFormat:@"%.3f",temp]];
        [Test_value replaceObjectAtIndex:index withObject:[NSString stringWithFormat:@"%.3f",temp]];
        [self refreshTable];
        //if (continue_test.state==0 && PF==false)
            //return;

    return;

After I removed some lines, I only remain the lines that add objects to table_array. Then it shows up error: Thread1: EXE_BAD_INSTRUTION after I pressed button.

[table_no addObject:[NSString stringWithFormat:@"%d",item]];
        [self Show_Datagrid:index];
        [table_value addObject:[NSString stringWithFormat:@"%.3f",temp]];
        [Test_value replaceObjectAtIndex:index withObject:[NSString stringWithFormat:@"%.3f",temp]];
        [self refreshTable];

I found the bug. This error solved.

An array only has one object but I call the 2nd index of that array, so it caused the error.

Thread1: EXE_BAD_INSTRUTION. How does this error show up, I just removed some line that are not important?
 
 
Q