我有一个视图控制器,称为 TVOutViewController (.h & .m),它应该处理我的外部屏幕。我如何“告诉”视图控制器这样做?
我已经做了什么:
NSLog(@"Current Number of screens: %i", [[UIScreen screens] count]);
if([[UIScreen screens]count] > 1) {
CGSize maxSize;
UIScreenMode *maxScreenMode;
for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++)
{
UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i];
if(current.size.width > maxSize.width)
{
maxSize = current.size;
maxScreenMode = current;
}
}
UIScreen *externalScreen = [[UIScreen screens] objectAtIndex:1];
externalScreen.currentMode = maxScreenMode;
所以现在我的阵列中有一个外部屏幕(并且被识别)。但是我怎样才能在这个屏幕上添加(例如)标签?
有没有这样的方法:
Screen Handled by the TVOutViewController = TheExternalScreen //Pseudocode
[Screen Handled by the TVOutViewController addSubview: aLabel]; //Pseudocode
谢谢!