The error message is cleared. One line of code was missing when I created my own UIBezierPath:
[path moveToPoint:CGPointMake(0, 0)]
I added it, and everything worked like a charm.
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(0, 0)];
[path addLineToPoint:CGPointMake(160, 140)];
[path addLineToPoint:CGPointMake(40.0, 140)];
[path addLineToPoint:CGPointMake(0.0, 40.0)];
[path closePath]
Interestingly, the error occurred when I tried to draw a line, and not earlier - when I created it.
source
share