Xcode 7.3: Failed to insert new output connection and remove DerivedData not working

The most common answer for this question on SO is 3 years, and the generally accepted solution (remove DerivedData) does not work for me, so I need to repeat ask this question.

this is a problem that I have, optically looks the same

I'm trying to drag to create an outlet for my table.

as mentioned, removing DerivedData does nothing for me (but I see that it is being reindexed). The second most common answer is

Removing (deleting the link, not deleting) and then adding the appropriate file (the class file to which you want to add output) is actually enough.

Edit 1 I found that after unchecking (in Xcode 6.3.1) I had to wait a few seconds for the indexing to appear and end in the project name box. The same goes for the return trip. This increases the chances of fixing the problem in almost all (but not all) cases.

Edit 2 Deleting a link means that you are not deleting the file completely, but simply delete it from the project (it still exists in your project folder, add it later).

I do not know if this applies to Xcode 7.3 since I am working on a storyboard and do not have any .h or .m files for deleting or deleting links. If this tip is still valid in xcode 7.3, could you please advise where to click?

Other things I tried that didn't work

  • cleaning project
  • reboot xcode
  • in terminal: defaults delete com.apple.dt.Xcode
  • in terminal: defaults write com.apple.dt.XCode IDEIndexDisable 0
  • rewrite the whole project from scratch

Help brother?

+5
source share
8 answers

I found a way to systematically reproduce this error in a simple way

  • Drag the azure line onto the ViewController and leave the drag inside the tooltip ("Insert Outlet or OutletCollection"): Create a connection window looks fine

enter image description here

  • Now after clicking the "Connect" ... BUUM! " Unable to insert new output connection "

enter image description here

  • Finally, try to do the same, but leaving the drag and drop outside the tooltip

enter image description here

  • After clicking "Connect" you will find that everything is working fine now!

    Hope this help!

+3
source

Hi, future xcode n00bs (I hate it when the loop is not closed by the appellor!), Please refer to @ Paulw11's comment. who fixed it for me

You can simply create an IBOutlet manually, and then drag the IB “new referencing output” onto your view controller object on the left (you will need to expand this panel first, the screen shot is currently hidden) and establish a connection. auxiliary view is often a little fluffy

+11
source

what worked for me is to delete the class file (which, as it turned out, is located in the Base Project folder)
- create a new file in the default project folder.

btw I tried to delete the received data before, and there was still the same error.

+1
source

An easy solution for me was to create a new ViewController class and reassign this class to the storyboard. Then I was able to use IBOutlets by clicking and dragging as usual.

My problem seems to have been caused by an attempt to rename a class. I renamed the file to code and reconnected it in the storyboard. But IBOutlets seem to have a problem renaming classes.

+1
source

I tried many options without good results, in the end I opened the terminal and typed:

defaults delete com.apple.dt.XCode IDEIndexDisable

Then I restarted mac and opened Xcode again, now it works (it even solves problems with autocompletion)

+1
source

None of the above solutions worked for me. (deleting the data received, deleting the target class file and re-adding it, creating a new target class file and copying and pasting the text there, restarting xcode, restarting the Mac, a clean, clean build folder, or any combination that I might think, etc. .)

In the end, what worked was adding a line to the target class (for example, print("dummy") ), and then building the project .

I can only guess why. I assume that none of the other solutions led to a new compilation of the target class file. Somehow xcode "knows" for which classes the code has changed. Adding an empty line or comment line did not work by the way. Xcode is smart, and if you add a comment or an empty line, no new compilation is required. It must be compiled code. Again ... just a hunch. They also have no idea why deleting derived data, a clean and clean build folder do not work.

+1
source

If this does not work to drag the connection from the storyboard or tip, you can do this from the Connection inspector. Click and drag the + sign to New Link.

Worked for me on xCode 7.3.

enter image description here

0
source

In my case, it was another file (for example, HeaderCell.Swift), which I accidentally deleted, but was part of the compilation sources. Xcode did not show the actual problem, but incorrectly displayed “Failed to insert new output connection” for (FooterCell.swift and FooterCell.xib). After I restored the HeaderCell.Swift file, the IBOutlet connection worked fine.

0
source

All Articles