self.window.rootViewController vs window addSubview

后端 未结 5 641
一向
一向 2020-12-05 04:17

I\'ve noticed a lot of examples for iPhone apps in the Application Delegate

- (void)applicationDidFinishLaunching:(UIApplication *)application

h

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 04:37

    Just an update on this with the release of ios 6.

    If still using the -[UIWindow addsubview:] boilerplate, you will probably get the message "Application windows are expected to have a root view controller at the end of application launch" in your console as well now. Along with potential rotation issues and layout issues in your app.

    Setting the window's rootViewController as above will fix this too.

提交回复
热议问题