In Xcode, we are able to connect an interface element to the corresponding code file in the storyboard edit interface or the Xib editing interface by means of a "control key + drag". Create the outlet in the code file.
It's just that. Suppose your luck is not very good. You may experience the following error while running the above operation:
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.
Let's say you're having this 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 common situation and the corresponding solution.
First, the first is the simplest and easiest to ignore, that is, you do not have the option to add the class to the corresponding "Target" when you create a new class.
The check method is very easy, select the. m file for the class you need to manipulate. In the "File Inspector" interface, "target membership" to confirm that the corresponding "target" is not selected, assuming that you do not have to select the time you create the class made a small error.
The change method is very easy, just choose the corresponding target in the "File Inspector" Interface "target Membership".
Assuming your situation and the above, it is possible that your project derive file a bit of a problem, the solution has the following several, the principle is almost the same, is to try to rebuild some background files of the project.
1. Once again, add the document 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 choose the "file-and Add files to ..." menu and select the. m file and. h file in the document selection screen to add them to the project again.
2. Delete Derivedata directly
The procedure is to close the current project and then close Xcode. The following folders are then found through terminal or the Finder:
~/library/developer/xcode/deriveddata
Find the files that begin with your project and delete them.
Then another time to start Xcode
3. Delete the project's Derivedata in organizer
Suppose you don't understand the Mac operating system. Do not know the hypothetical operation of the 2nd solution, there is a more direct way, is to select "Windows->organizer" in Xcode, and then select "Projects", select the item you are working on, click "Derivedata" corresponding " Delete Button,xcode will delete the derivedata of the item. And then you take the initiative to build one again.
Hopefully the above method will help you solve the problem of "Could not insert new outlet connection".
IOS Xcode, addressing the issue of "Could not insert new outlet connection".