I have a UIView on which I draw a UIBezierPath with my finger. When I re-view the view (say, after the path is drawn), the redraw function is launched, which retells BezierPath:
- (void)redrawPathsWithScale:(float)scale { [_path applyTransform:CGAffineTransformMakeScale(scale, scale)]; [self setNeedsDisplay]; }
setNeedsDisplay calls the drawRect call. Now every time I approach the absolute scale somewhere near x6, I immediately get a memory warning and the application crashes.
My drawRect method is as follows:
- (void)drawRect:(CGRect)rect { [_path strokeWithBlendMode:kCGBlendModeNormal alpha:1.0]; }
Curious: does not implement drawRect at all removes the warning about memory. Implementing an empty drawRect still fails!
source share