Grabbing MKMapView screenshot programmatically does not work for iOS6

Originator:honcheng
Number:rdar://11813051 Date Originated:06-Jul-2012 05:15 AM
Status:Closed Resolved:Yes
Product:iPhone SDK Product Version:iOS6b2
Classification:UI/Usability Reproducible:Always
 
06-Jul-2012 05:15 AM Hon Cheng Muh:
Summary:
Using UIGraphicsBeginImageContextWithOptions, it is possible to grab a screenshot of MKMapView before iOS6. 
But this method fails in iOS6 because MKMapView in iOS6 is done with OpenGL. Tried different methods to take screenshot for OpenGL instead but it was not working. Approach 2 Apple engineers at the MapKit lab at WWDC about the issue. One of the engineer told me that this is definitely a bug, and I should be able to just use UIGraphicsBeginImageContextWithOptions to take screenshots, and there is no need to use OpenGL methods. 
Spotted the issue in iOS6b1, continues in iOS6b2

Steps to Reproduce:
Use UIGraphicsBeginImageContextWithOptions to grab a screenshot of a MKMapView

Expected Results:
Get a image containing the map

Actual Results:
A blank beige-colored image, with a small text label on the bottom left. 

Regression:

Notes:

Comments

Filed Dupe: rdar://11920682


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!