Sometimes you could need to take screenshots programmatically for your OpenGL ES application on iOS: you could use it to capture the "best moments in the game" to show them later, or send them via email, or share on some social network; or simply you could hate to have to press two buttons in sync to have a screenshot. Anyway here is some source code to do it, ready to be used with Cocos2D 1.0.