I am no idiot when it comes to for loops. I have to use them all the time when it comes to Perl and I KNOW the syntax. How on earth is this syntax wrong and cause the program to crash. And I thought Macs weren't supposed to Crash?
basically I am tring to print the array to NSLog to test to see if the addObject is adding it correctly. I am attempting step by step to eventually print this to a text field screen, which I don't know how to do either. So Question number one, why is the for loop screwing everthing up and if I take it out why does it function correctly? Question number two: How do I set this to show up in a text field (the class is NSScrollView)?
Code:
- (IBAction)NextButton:(id)sender
{
if([arc118clq state]==NSOnState) {
// printerarray[i] = Printer1;
arrPRN = [NSMutableArray new];
[arrPRN addObject:@"ARC-118-CLQ"];
} else if([cse211clq state]==NSOnState) {
// printerarray[i] = Printer1;
//arrPRN = [NSMutableArray new];
[arrPRN addObject:@"CSE-211-CLQ"];
} else if([hubatlabclq state]==NSOnState) {
// printerarray[i] = Printer1;
//arrPRN = [NSMutableArray new];
[arrPRN addObject:@"HUB-ATLAB-CLQ"];
} else if([nrnatlabclq state]==NSOnState) {
// printerarray[i] = Printer1;
//arrPRN = [NSMutableArray new];
[arrPRN addObject:@"NRN-ATLAB-CLQ"];
}
int ind;
for(ind=0; ind<17; ind++) {
NSLog(@"%@", arrPRN[ind]);
}
[prnSelector orderOut:nil];
[prnOverview makeKeyAndOrderFront:nil];
}
basically I am tring to print the array to NSLog to test to see if the addObject is adding it correctly. I am attempting step by step to eventually print this to a text field screen, which I don't know how to do either. So Question number one, why is the for loop screwing everthing up and if I take it out why does it function correctly? Question number two: How do I set this to show up in a text field (the class is NSScrollView)?