Dev
Dev

Reputation: 3945

subviews of window in ios 6.0

I had added 5 view controllers as subviews to window in appDelegate. But when Iam trying to NSLog the subviews of window only one subview is printing. Why ? It was working in ios 5. Now I updated xcode to ios 6.0.

And also Iam getting a message like "Application windows are expected to have a root view controller at the end of application launch" in the log when Iam running the application

Upvotes: 2

Views: 760

Answers (1)

micamoita
micamoita

Reputation: 450

Starting with iOS 6 adding subviews to the window object is not the way to go. You have to set one view controller as the rootViewController of the window object, for example:

window.rootViewController = myViewController;

If you then want to have the views of more than one viewController on the screen, you can add them to myViewController's view as subviews (as you previously did directly on the window object).

Upvotes: 3

Related Questions