I have a program running beautifully on my iPhone 4. It uses a class UIView I created (called TestView) to draw graphics using Quartz (very simply graphics such as just a few CG lines and circles). I need, however, to take advantage of the new higher resolution screen on the iPhone 4. Currently, the ensure backwards compatibility with iPhone 3, moving by a single "point" in your code causes a movement of 2 pixels on the iPhone 4 screen. By updating a UIView to a scale factor of 2.0, you can change the mapping from logical coordinate space to pixel space to take advantage of the higher resolution of the iPhone 4. It should be easy; I just can't find any documentation on how to change the UIView scale factor.
For example, any line I draw, which should is specified by the function CGContextSetLineWidth(context, 1.0); ends up drawing a line 2 pixels wide. I need to change this to actually draw one pixel wide.
I find explanations but no examples or method for changing scale factors in Apples explanation of supporting hi res screens:
UIView documentation gives a contentScaleFactor attribute, but no "set" method. Change the line below from ttp:// to http:// to turn into URL:
ttp://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/cl/UIView