I have an NSNumber being passed to be via a 3rd party API, and when I call intValue on the index I get a EXC_BAD_ACCESS error:
-(CPFill *) barFillForBarPlot:(CPBarPlot *)barPlot recordIndex:(NSNumber *)index;
{
NSLog(@"bar index %i", index);
int value = [index intValue];
}
The output I get in the debugger is:
bar index 0
bar index 1
Program received signal: “EXC_BAD_ACCESS”.
What the heck is going on?
I have noticed that the first time the method is called, index is nil but the next time its obviously not...
How can I debug this?!?! Its such a trivial thing, but I cant seem to fix it!