Could not insert new outlet connection [duplicate]

2019-01-07 06:00发布

This question already has an answer here:

Could not insert new outlet connection: Could not find any information for the class and not showing any class named "ViewController"

Solutions I have done : - Restarted XCode - Restarted System - Deleted the Deriveddata contents from /Library/developer/xcode

But nothing worked for me

Here is the screenshot for the error enter image description here

9条回答
时光不老,我们不散
2楼-- · 2019-01-07 06:36

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..

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-01-07 06:39

Finally I did it by removing the xcode completely from my mac and reinstall the xocde.dmg file and then install MobileDevice.pkg and MobileDeviceDevelopment.pkg residing on /Applications/Xcode.app/Contents/Resources/Packages

查看更多
祖国的老花朵
4楼-- · 2019-01-07 06:41

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.

查看更多
Ridiculous、
5楼-- · 2019-01-07 06:42

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.

查看更多
做个烂人
6楼-- · 2019-01-07 06:48

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

查看更多
等我变得足够好
7楼-- · 2019-01-07 06:48

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.

查看更多
登录 后发表回答