没看懂,请问怎么解决?我使用“分析”导致我的程序由于内存问题而崩溃,七个类似符号中的第一个是“存储到信号线中的对象的潜在泄漏”连接到 CGContextStrokePath(signalContext);
- (void)drawHorizoLines{
for(int i = 1; i < self.frame.size.width/_sw;i++){
CGContextRef signalContext = UIGraphicsGetCurrentContext();
CGMutablePathRef signalLine = CGPathCreateMutable();
CGContextSetLineWidth(signalContext, 0.4); //LineWidth
CGContextBeginPath(signalContext);
CGContextSetStrokeColorWithColor(signalContext, [UIColor purpleColor].CGColor);
CGPathMoveToPoint(signalLine, 0, 0, i*_rowHeigth + _sbd/2);//Startpoint
CGPathAddLineToPoint(signalLine, 0, self.frame.size.width, i*_rowHeigth + _sbd/2);
CGContextAddPath(signalContext, signalLine);
//CGContextClosePath(signalLine); didnt work
CGContextStrokePath(signalContext);
//CGContextRelease(signalContext); didnt work
}
}