I have a small piece of code, that draws a circle as CAShapeLayer:
- (void) viewWillAppear:(BOOL)animated {
CGFloat size = MIN(self.view.frame.size.width, self.view.frame.size.height);
CAShapeLayer *circleLayer = [CAShapeLayer layer];
circleLayer.fillColor = [[UIColor redColor] CGColor];
circleLayer.frame = CGRectMake((self.view.frame.size.width - size) / 2.0 ,(self.view.frame.size.height - size) / 2.0, size, size);
CGMutablePathRef pathRef = CGPathCreateMutable();
CGPathAddEllipseInRect(pathRef, NULL, CGRectMake(0, 0, size, size));
circleLayer.path = pathRef;
CGPathRelease(pathRef);
[self.view.layer addSublayer:circleLayer];
}
The circle is shown correctly on iPad 2 and in simulator in non-retina mode. When I switch the simulator into retina mode, the circle is not shown at all. Unfortunately, I don't have an actual iPad 3 yet, so I cannot say, if it works on actual device. Can anyone exlain, what I am doing wrong?
Update: I reported this as a bug to Apple. They told me, that the bug is duplicate and the other bug was still open. After a while it got closed, but after the last XCode update it is still reproducible
Update 2: Checked it on a real iPad 3. Works correctly.