【发布时间】:2015-06-05 13:43:57
【问题描述】:
假设我在 'drawRect:rect' 方法中获取当前上下文并创建一个路径。调用 'CGContextDrawPath' 方法后这条路径会是什么? 它会被安全释放或导致内存泄漏,还是保持不变?我是否需要手动调用“CGPathRelease”
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);
【问题讨论】:
标签: objective-c core-graphics cgpath