【发布时间】:2011-03-08 11:08:00
【问题描述】:
你好,这是我在 CATiledlayer 中绘制 pdf 的代码
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
{
CGContextSetRGBFillColor(ctx, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(myPageRef, kCGPDFCropBox, layer.bounds, 0, true));
CGContextDrawPDFPage(ctx, myPageRef);
}
一切都很好,但我在下一行收到内存泄漏警告
CGContextDrawPDFPage(ctx, myPageRef);
这里 myPageRef 是 CGPDFPageRef
【问题讨论】: