THIS IS ELLIE

AppDelegate must implement the window property 문제 해결 본문

낑낑/Troubleshooting

AppDelegate must implement the window property 문제 해결

Ellie Kim 2020. 1. 29. 17:35

아이폰 6s 플러스 기기로 UIResponder테스트를 하려 했으나 ,,, 화면이 나타나지 않는 문제가 발생했다.

Xcode버전은 11.1 이였고 iOS deployment target은 iOS 12.2였다.

Xcode의 디버그창에는 The app delegate must implement the window property if it wants to use a main storyboard file.이라고 나타낸다.

즉 메인 스토리 보드 파일을 사용하려면 앱 델리게이트가 window 프로퍼티를 구현해야 한다.

이전에는 Xcode에서 프로젝트가 생성될 경우 자동으로 AppDelegate에 window객체를 생성해주지만,

iOS 13부터 SceneDelegate가 생성되면서 window 프로퍼티는 SceneDelegate에 생성되어 있다. 

 

내가 테스트하려는 기기는 iOS 13 버전 이하고 Xcode 버전은 높기 때문에

AppDelegate.h 헤더 파일에 윈도우 프로퍼티를 구현해준다.

그러면 화면이 잘 나타난다.

 

 

반응형