Hi,
Take a look at this code:
Code:
NSLog(@"count = %i", [[connectDotsLineX objectAtIndex:index] count]);
for (int newIndex = 0; newIndex < [[connectDotsLineX objectAtIndex:index] count]; newIndex++)
{
int x1, x2, y1, y2;
int previousIndex = newIndex - 1;
x1 = [[[connectDotsLineX objectAtIndex:index] objectAtIndex:previousIndex] intValue];
x2 = [[[connectDotsLineX objectAtIndex:index] objectAtIndex:newIndex] intValue];
y1 = [[[connectDotsLineY objectAtIndex:index] objectAtIndex:previousIndex] intValue];
y2 = [[[connectDotsLineY objectAtIndex:index] objectAtIndex:newIndex] intValue];
...
There doesn't appear to be anything wrong with it to me, but then I'm only a beginner. This section is giving me:
Code:
2011-03-01 09:55:24.737 The Escherizer[89042:207] count = 2
2011-03-01 09:55:24.739 The Escherizer[89042:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 4294967295 beyond bounds [0 .. 1]'
Where did the 4294967295 come from?!? Only after I added those last 6 lines did it give me this exception. What is going on here?
Thanks!