Suppose that I get the current context in 'drawRect:rect' method and create a path. What will this path be after calling 'CGContextDrawPath' method? Will it be released safely or cause memory leak, or just remain the same? Do I need to call 'CGPathRelease' manually
CGContextRef context = UIGraphicsGetCurrentContext();
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, nil, 20, 50);
CGPathAddLineToPoint(path, nil, 20, 100);
CGContextAddPath(context, path);
//Do something else here
CGContextDrawPath(context, kCGPathFillStroke);
Yes you have to call CGPathRelease manually. Remember ARC does not manage Core Foundation objects. Here is some reading material