Presenting and Managing Views with UIViewController
Problem
You want to switch among different views in your
application.
Solution
Use the UIViewController class.
(
Apple’s strategy for iOS development was to use the model-view-controller
(MVC) division
of labor.
Views are what get displayed to users, while the model is the data
that
the app manages, or the engine of the app.
The controller is the bridge between the model and the view.
The controller, or in this case, the view controller, manages the relationship between the view and the model.
)
creating a view controller without a .xib file
1. created an application using the Empty Application template in Xcode
2. create a new view controller for your app
a) In Xcode, select the File menu and then choose New → New File...
b) In the New File dialog, make sure iOS is the
selected category on the left and
that
Cocoa Touch
is the chosen subcategory. Once you’ve done that, select the
New
Objective-C
class
c) On the next screen, make sure that the “Subclass of ”
the text field says UIView
Controller. Also make sure that neither the “Targeted for iPad” nor the “With
XIB
for user interface”
checkboxes is selected
IOS 7 Study - UIViewController
原文:http://www.cnblogs.com/davidgu/p/3543472.html