IOS Xcode, addressing the issue of "Could not insert new outlet connection".

Source: Internet
Author: User

In Xcode, we can connect an interface element to the corresponding code file in the storyboard edit interface or the Xib editing interface by "Control + drag" to create a outlet in the code file.


However, if your luck is not very good, you may encounter the following error in the process of performing the above actions:

Could not insert new outlet connection:could not find any information for the class named "XXX".

The "XXX" is the class name in your target code file.


If you encounter such a problem, take the error message above to Baidu will find a lot of relevant content, there are a variety of solutions, but the effect of the controversy, some people say that the method is easy to use, some people say that the method is good, here to tidy up a few common situations and corresponding solutions.


The first case is the simplest, and the most easily overlooked, is that you do not have the option to add the class to the corresponding "Target" when you create a new class.

Check the method is very simple, select the class you need to manipulate the. m file, in the "File Inspector" interface, "target membership" to confirm that the corresponding "target" is not selected, if not checked, you have made a small error in the creation of the class.

The modification method is very simple, just choose the corresponding target in the "File Inspector" Interface "target Membership".


If your situation and above do not match, it is possible that your project derive file a bit of a problem, the solution has the following, the principle is similar, is to try to rebuild some background files of the project.


1. Re-add files to the project

The procedure is to select the problematic. m and. h files, click the Delete key, and then select "Remove Reference" so that the file is not actually deleted. Then select the "file-and Add files to ..." menu and choose the. m file and the. h file to re-join the project in the document selection screen.


2. Delete Derivedata directly

The procedure is to close the current project, then close Xcode, and then locate the following directory through terminal or the Finder:

~/library/developer/xcode/deriveddata

Find the files that begin with your project and delete them.

Then restart Xcode


3. Delete the project's Derivedata in organizer

If you do not understand the Mac operating system, do not know if the operation of the 2nd solution, there is a more direct way, is to select "Windows->organizer" in Xcode, then select "Projects", select the project you are working on, click " Derivedata "Delete" button, Xcode will delete the item's Derivedata and then automatically regenerate one.


I hope the above method can help you solve the problem of "Could not insert new outlet connection".

IOS Xcode, addressing the issue of "Could not insert new outlet connection".

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.