Apple recommends using CGContextSetFillColorWithColor instead of CGContextSetFillColor.
CGContextSetFillColor ... The current fill color space must not be a pattern color space. For information on setting the fill color when using a pattern color space, see CGContextSetFillPattern. Note that the preferred API to use is now CGContextSetFillColorWithColor.
Why is it 'preferred?'
Could continuing to use CGContextSetFillColor have consequences with drawRect? See my issue where drawRect leaves parts of the image behind.
It certainly causes problems when I mixed both.
CGContextSetFillColorWithColor(ctx, [[UIColor whiteColor] CGColor]);
CGRect fullBox = CGRectMake(xOffset, yOffset, kScoreBoxWidth * 17, 2 * (kScoreBoxHeight-2));
CGContextAddRect(ctx, fullBox);
CGContextFillPath(ctx);
- Notice the graphs are filled with grey instead of green|yellow|red squares...