I am presenting a View to the screen like this:
imageLayer.alpha=0;
imageLayer.image = nil;
[self presentModalViewController:sampleView animated:YES];
The issue I am having is that the contents of imageLayer (which is a UIImageView) appear upside down and backwards in sampleView when it loads. The layer inside sampleView that contains the contents of imageLayer is a custom UIView that caches portions of the screen as a bitmap using: CGBitmapContextCreate. In trying to troubleshoot this I’ve found that if imageLayer is not present the problem disappears. Above I’ve tried setting the alpha to 0 and image to nil (which removes it from the screen before presentModalViewController fires). Why would the image show up backwards and upside down in a separate view?
In SampleView I was using CGBitmapContextCreate but I was not sending NULL as the first parameter (I had copied some code from the net and it had a value in there) Once I set NULL as the first value the problem went away.