Could not insert new outlet connection: Could not

2019-01-20 21:33发布

I got an error on Xcode saying that there was no information about the view controller.

Could not insert new outlet connection: Could not find any information for the class named

Why is this happening?

Screenshot 1

19条回答
Fickle 薄情
2楼-- · 2019-01-20 22:26

It happened when I added a Swift file into an Objective-C project .
So , in this situation what you can do is . .

  • Select MY_FILE.Swift >> Delete >> Remove Reference
  • Select MY_FOLDER >> Add MY_FILE.Swift
  • Voila ! You are good to go .
查看更多
等我变得足够好
3楼-- · 2019-01-20 22:27

For me it worked when on the right tab > Localization, I checked English check box. Initially only Base was checked. After that I had no more problems. Hope this helps!

查看更多
戒情不戒烟
4楼-- · 2019-01-20 22:27

Please perform the following two steps only to get rid of this error.

1.  Clean Project using Product -> clean.
2.  Run the Project.

Now try to add/Connect the actions or outlets.

Working Fine for me for many times.

查看更多
干净又极端
5楼-- · 2019-01-20 22:28
  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.
查看更多
可以哭但决不认输i
6楼-- · 2019-01-20 22:30

I had the same problem. I realised than in X-Code Manual item was selected when I tried to create an outlet by control-drag

enter image description here

After I set it to automatic it worked

enter image description here

查看更多
虎瘦雄心在
7楼-- · 2019-01-20 22:30

I solved this problem by programmatically creating the Labels and Textfields, and then Command-Dragged from the little empty circles on the left of the code to the components on the Storyboard. To illustrate my point: I wrote @IBOutlet weak var HelloLabel: UILabel!, and then pressed Command and dragged the code into the component on the storyboard.

查看更多
登录 后发表回答