This is really strange. I have a scrollview that contains a three images, and the user swipes to see the next image. However, I want the first screen to start at the middle image. Easy; I'll use setContentOffset and all will be fine.
The code works on the iPhone simulator, but not on the iPad simulator (or device!)
CGRect screen = [[UIScreen mainScreen] bounds];
CGFloat height = CGRectGetHeight(screen);
CGFloat width = CGRectGetWidth(screen);
CGPoint rightOffset = CGPointMake(width, 0);
[scrollView setContentOffset:rightOffset animated:YES];
All set just before the scrollView is added (and in fact we can do this after the scrollview is added with the same result).
width is returning 768 on ipad and 320 on the iphone.
Is this a bug? Xcode 4.4.1 and ios 6.
edit:
Looks like this is to do with creation order; moved to viewWillAppear rather than viewDidLoad and apparently working on iphone and ipad. Just the inconsistency is very surprising....