Airplay와 Apple TV를 사용하여 2 개의 UIScreens를 처리하도록 프로그램을 작성한 다음 TV UIScreen과 iPad UIScreen 모두에 대해 별도의 루트보기 컨트롤러를 설정할 수 있습니다. 그런 다음 TV의보기 컨트롤러에 이미지 또는 슬라이드 쇼를 표시하고 iPads보기 컨트롤러의 이벤트에서 실행하십시오!
는 CLIFS의 COMMENT 후에 개정 된 :
을 그래서 먼저 앱 위임에 didFinishLaunchingWithOptions 또는 연결 않은 화면을 받도록 설정에게 통지를 didFinishLaunching에.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil];
그런 다음 별도의 창에 대한 참조를 유지하고 다른 창처럼 컨트롤러를 밀어 넣어야합니다.
- (void) myScreenInit:(UIScreen *)connectedScreen:(UIViewController*)mynewViewController
{
//Intitialise TV Screen
if(!windowTV)
{
CGRect frame = connectedScreen.bounds;
windowTV = [[UIWindow alloc] initWithFrame:frame];
windowTV.backgroundColor = [UIColor clearColor];
[windowTV setScreen:connectedScreen];
windowTV.hidden = NO;
}
UIViewController* release = windowTV.rootViewController;
windowTV.rootViewController = mynewViewController;
[release removeFromParentViewController];
[release release];
}
- (void)setTvController:(UIViewController*)mynewViewController
{
UIViewController* release = windowTV.rootViewController;
windowTV.rootViewController = mynewViewController;
[release removeFromParentViewController];
[release release];
}
- (void)screenDidConnect:(NSNotification *)notification {
[self myScreenInit:[notification object]];
}
실제로 AirPlay를 실험하고 있습니다. iPhone 4s. 작업 표시 줄에있는 airplay 컨트롤에 미러 옵션을 설정 한 후에 만 Apple TV 2에서 작동하도록했습니다. 비슷한 질문을 게시하기 전에 다른 가능한 답변을 찾아 보겠습니다. – Cliff
수 있습니다. 당신은 정확하게 내 대답을 표시 할 것입니까? 분명히 지금까지는이 많은 상향 회선이 정확하다고 여겨졌습니다. – Dev2rights