views:

152

answers:

2

Is it possible to simply duplicate ipad display to TV out (assuming both have same resolution)?

Code like this doesnt seem to work (it is a pretty naive implementation)

    int i=0;
    for (UIScreen *screen in [UIScreen screens])
    {
     if(i>0)
     {          
        UIWindow* extWindow = [[UIWindow alloc]init];
        extWindow.screen =screen;
        [extWindow addSubview:viewController.view];
        [extWindow makeKeyAndVisible];
     }
    i++;
    }

   [window addSubview:viewController.view];
   [window makeKeyAndVisible];
A: 

Code like this doesnt seem to work (it is a pretty naive implementation)

This code looks like a mishmash. I haven't used external screens before, but your inner if block is creating anonymous UIWindow objects, assigning a property, and then leaking them at the end of the block (no release) -- and that definitely won't do what you intend.

You should consult the iPad Programming Guide, specifically, Support for External Displays and Projectors, which summarizes how your code should be written.

Shaggy Frog
yes you are right, but that is why i mentioned that this is a 'naive implementation' written hastily...
adrin
A naive implementation would still be functional. This code is non-functional.
Shaggy Frog
A: 

If you need this for a demo presentation, then there are few apps that will duplicate the screen for you while running your app like TVOut, TVOut2, Screenspltr. However there is a catch, these apps are not approved by Apple therefore are not in the app store, in order to install them you'll need to jailbreak it and it comes with the involved risks. However for a quick dome it is probably the best solution.

Guy Ephraim