1. The first simple solution without paying any money is to do it on the programming level: you can capture the screen image of the iPhone inside your app, so this is the clue that you can use to first take the screen shot and send it via TCP network connection to a remote computer which can show the screen image. You can use the following code to capture the screen and convert the image to jpeg format. Of course you should use asynchronize TCP connection to send the image data, otherwise the user interface of your app will stop working for some time while sending the image. On the remote computer, you also need to build an application which first listens to a port of the computer, and then receives an image and displays it.
// Capture Screenshot
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *data=UIImageJPEGRepresentation(screenshotImage,self.jpegCompressionRate);
NSUInteger len=[data length];
2. another solution is to use the Apple VGA cable:
http://store.apple.com/sg/product/MC552ZM/B?fnode=MTc0MjU4NjE&mco=MjEzNTM1NjI
, together with the TVOutManager as described on the following web page:
http://www.touchcentric.com/blog/archives/123
The steps of using this TVOutManager are quite clear and simple.
I first used the TVOutManager in my app on iPhone, and it works really very well.
I then used it in my app on iPad, and unfortunately it slowed down my app.
I guess the reason is that the TVOutManager needs lots of computing power to show the screen.
After investigating for a long time, I finally found the way: in the source file TVOutManager.m, you can find two lines:
// #define USE_UIGETSCREENIMAGE, and you just need to let the two lines work. As a result, your app will work much faster.
// CGImageRef UIGetScreenImage();
3. in fact the Apple VGA cable can directly project the real-time screen output of iPad 2 to the projector, but can only show the video and pictures for the iPhone 4 or iPad 1. If you have iPad 2, then you just need to buy the cable to project anything to the projector.