I know that in AppDelegate.m, you must set the root controller for the application. Otherwise you will see nothing in your App and receive a warning.
I found that some materials use:
[window addSubview:anyViewController.view];
or use:
window.rootViewController = anyViewController;
Both methods could make the App start correctly. I can’t understand why the first method doesn’t set the rootviewController for the user, but it still works well. Why is this? What is the difference between them?
rootViewControllerwas added with iOS4 and is the newer and recommended method.