Loaded the "myview" nib but the view outlet was not set error

Source: Internet
Author: User

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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.