3

I want to write an iPad application that uses extern TV. To detect external displays, I use the recommended code:

- (void)viewDidLoad
  {
    [super viewDidLoad];
    // ...

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidChange:) name:UIScreenDidConnectNotification        object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidChange:) name:UIScreenDidDisconnectNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidChange:) name:UIScreenModeDidChangeNotification object:nil];
    //...
  }

// ...

- (void)screenDidChange:(NSNotification *)notification
  {
    // ...
  }

However, if I run this in the simulator and switch TV's resolution (or switch "TV out" on or off) I do not get the notification but the application terminates by sigterm.

Is there any way to test this in the simulator?

Matthias
  • 8,018
  • 2
  • 27
  • 53

0 Answers0