Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not insert new outlet connection [duplicate]

Tags:

ios6

xib

xcode4.6

I got the same problem as you today... I think this is a bug of Xcode, below is the way to fix the issue:

  1. Close the project you are working on with.
  2. Delete your project's【DerivedData】folder. (This folder may inside your project's folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you.
  3. restart your project.

After these steps, the problem should be solved. And from my experience, these steps can solve many Xcode problems, so if you got some problem with Xcode again, try these steps first.


Removing(removing reference, not deleting) and then adding the appropriate file(the file of class you want to add the outlet to) 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 complete in the project name box. Same for the way backwards. This increased chances to fix the issue in almost all (but not all) cases.

Edit 2 Removing reference means that You do not delete the file completely but just remove it from the project (it still exist in the folder of your project, you add it later).

enter image description here


That's most often a problem of file indexing.

To fix it try to clean your target and if this doesn't work, go to your Derived Datafolder and delete your application there. This will force xCode to reindex the files


Just got the same issue on Xcode 4.6.2.
Tried solutions presented in different answers/comments, but it still didn't work.

Then all I did was to just:

  1. save all my work;
  2. just quit Xcode & load it again;
  3. then I was able to insert the new outlet connection successfully.

Hope this will save some time/frustration for somebody else.


Personally, I had the same problem: "could not insert new outlet connection" AND when I was starting typing something like "UI..." XCode wasn't doing anything. I searched for answers, I tried several things... but it was just an unchecked box. When I was creating a new class, XCode unchecked the box linking the class to the project (I guess).

I can't post a screen shot because I don't have 10 reputations but when you create your class, XCode asks you where you want to save it. Down the finder window, you have 'Targets' and two boxes: 'YouProjectName' and 'YouProjectNameTests'. You should check the first one (at least).

Hope this will help. I saw different discussions about the subject.

screenshot when creating your new class


I recently came across this problem. I soon realized that the cause had been my own doing. I had previously disabled XCode indexing (which used to take forever & eat up my RAM), using the below code in a terminal window:

defaults write com.apple.dt.XCode IDEIndexDisable 1

To revert XCode to its default state, i used the following line in a terminal window:

defaults write com.apple.dt.XCode IDEIndexDisable 0

Voila! All's well again..


If you've imported the Class into your Xcode Project you have to manually add the Class (.m file) to your 'Compile Sources'.

Select project icon > TARGETS > Build Phases > Compile Sources Click the + button and add your *.m file.