I am testing out using CATiledLayer to draw images and it seems much faster (oddly) than using the default layer even though more drawing operations take place
In drawRect I have:
CGContextRef context = UIGraphicsGetCurrentContext () ;
CGContextSaveGState (context) ;
CGContextTranslateCTM (context, referencePoint.x, referencePoint.y) ;
CGContextScaleCTM(context, zoom * pixelScalingX / SCALE, zoom * pixelScalingY / SCALE) ;
CGContextRotateCTM (context, displayRotation) ;
CGPoint point = CGPointMake(displayCorner.x, displayCorner.y) ;
UIImage *image = [self getChartImage] ;
[image drawAtPoint:point] ;
CGContextRestoreGState(context) ;
The problem that I am getting is unpredictable access violation crashes at [image drawAtPoint].
This suggests to me a thread safety problem.
This article mentions thread safety
https://developer.apple.com/library/ios/qa/qa1637/_index.html
but appears to say the issues are resolved now. That does not seem to be the case.
My questions then are:
The answer is CATiledLayer drawing is not thread safe. You have to use Core Graphics functions only. No UI anything.