I've been getting a EXC_BAD_ACCESS
error while drawing, filling and then stroking a path. Here is the code:
UIBezierPath *aPath = [UIBezierPath bezierPath];
[aPath moveToPoint:CGPointMake(0, 88)];
[aPath addLineToPoint:CGPointMake(interPoint, 0)];
[aPath addLineToPoint:CGPointMake(interPoint, 176)];
[aPath addLineToPoint:CGPointMake(0, 88)];
[aPath closePath];
[[UIColor blackColor] setStroke];
[[UIColor colorWithHue:0.1583 saturation:1 brightness:1 alpha:1.0] setFill];
aPath.lineWidth = 1;
[aPath fill];
[aPath stroke];
The error seems to be happening when the program gets to [aPath stroke]
. If I comment out [aPath stroke]
the error goes away. I know that an EXC_BAD_ACCESS
error has to do with memory management, but I can't figure out where the problem is. Any help would be great.