understand more about the UIViewController
when you build the application by using the interface builder, you will find that everything is linked up by default. when your application is being loaded up (in the function of didFinishLaunchingWithOptions) and you will find that the rootviewcontroller is created already.
trying to unlink the window with the app delegate
the finding is - the window object in the didFinishLaunchingWithOptions is pointing to nil, if you link it up, the window is not nil anymore.
if we are not using the IB to set the view
in this case, we simply link up the app delegate with the window object and the UIViewController.
if we are not using the interface builder to load up the view, we have to code it manually. there are 2 places where we can code it. the first place is didFinishLaunchingWithOptions in the app delegate, while another place is the loadview in the UIViewController.
how does the mvc model apply in iphone app
the job of each view controller object is two-fold. because it is part of your application’s controller layer, a view controller is responsible for coordinating interactions between your application’s visual presentation (your custom views) and your application’s data model (your custom objects). a view controller is also responsible for handling changes to the views that comprise its view layer. for example, when the user rotates a device from a portrait to a landscape orientation, the view controller is responsible for reorienting the views accordingly. fortunately, the default behavior of the UIViewController class handles much of the work needed to manage your view layer. all you have to do is specify the initial set of views and their default behaviors. after that, you can focus on the interactions between those views and your data model.
UIApplicationDelegate protocol
habour master
creating view-based app from window-based app in xcode
just boring, so creating view-based app from window-based app in xcode
- first, we create a window-based application from the xcode
- next, we add a new view controller class under the "Class"
- in the source coding, we try to link up the AppDelegate with the ViewController class.













































