After creating a project, follow these steps:
1. Adding Code to the agent class is generally not difficult. You can simply read the help documentation.
2. The main step is to set the mainwindow. XIB file and your view. XIB file.
In the outlet attribute of mainwindow, there are two attributes: viewcontroller, which points to your defined viewcontroller.
One is window. This usually points to the System window class.
Another is referencing outlet: delegate points to fileowner. The file owner of mainwindow is uiapplication.
3. The mainwindow. XIB File Created by the system template does not include viewcontroller. You need to add a view control class by yourself. Then, point the class of this class
Viewcontroller. H. M class added by yourself.
4. Add another view. XIB file. The file owner must be modified. The default value is nsobject.
5. The most important thing is that each viewcontroller has an internal view outlet, which must be added. Otherwise, you will encounter a similar error.
The view outlet is not set. It is because of this.
======================================
Terminating app due to uncaught exception 'nsinternalinconsistencyexception', reason: '-[uiviewcontroller _ loadviewfromnibnamed: Bundle:] loaded the "myview" nib but the view outlet was not set