Hi,
I'm writing a program that calculates the Jacobi algorithm. It's written in Objective-C since it runs on a Mac, but the majority is written in standard C. I'm using a two-dimensional C array and an NSArray
containing 5 NSTextField
labels.
The following code yields an EXC_BAD_ACCESS
error:
for ( int i = 0; i < 5; i++ ) {
NSString *resultString = [NSString stringWithFormat:@"%g", matrix[i][i] ];
[[resultLabels objectAtIndex:i] setStringValue:resultString]; // error line
}
Any help?
EDIT
Here's where I init
resultLabels
:
resultLabels = [[NSArray alloc] initWithObjects:result11, result22, result33, result44, result55, nil];