extern TV を使用する iPad アプリケーションを作成したいと考えています。外部ディスプレイを検出するには、推奨されるコードを使用します。
- (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
{
// ...
}
ただし、これをシミュレーターで実行して TV の解像度を切り替える (または「TV 出力」をオンまたはオフに切り替える) と、通知は表示されず、アプリケーションは終了しsigterm
ます。
シミュレーターでこれをテストする方法はありますか?