我的应用程序是使用以下代码绘制阴影时“的对象的潜在泄漏”:使用核心图形
-(void)drawShadow:(CGContextRef)context rect:(CGRect)rect{
CGContextSaveGState(context);
//Set color of current context
[[UIColor blackColor] set];
//Set shadow and color of shadow
CGContextSetShadowWithColor(context, CGSizeMake(0, 2), 3, [[UIColor colorWithWhite:0 alpha:0.5] CGColor]);
CGContextFillEllipseInRect(context, rect);
CGContextClipToMask(context, rect, CGBitmapContextCreateImage(context));
CGContextRestoreGState(context); // Warning shows in this line
}
当运行产品>分析,它标志着该块与该消息的最后一个指令:“潜在的物体泄漏”。当我删除该行时,它显示相同的消息,但在右括号中。
任何想法我做错了什么?
感谢