调试电视分辨率开关

时间:2013-10-22 06:26:29

标签: ios objective-c ipad ios-simulator sigterm

我想写一个使用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
  {
    // ...
  }

但是,如果我在模拟器中运行并切换电视的分辨率(或打开或关闭“电视输出”),我获取通知但应用程序终止sigterm

有没有办法在模拟器中测试?

0 个答案:

没有答案