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

IosSwiftXcodeInterface BuilderIboutlet

Ios Problem Overview


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

Ios Solutions


Solution 1 - Ios

Here are some things that can fix this (in increasing order of difficulty):

  • Clean the project (Product > Clean)

  • Manually paste in

      @IBOutlet weak var viewName: UIView!
      // or
      @IBAction func viewTapped(_ sender: Any) { }
    

    and control drag to it. (Change type as needed.) Also see this.

  • Completely close Xcode and restart your project.

  • Delete the Derived Data folder (Go to Xcode > Preferences > Locations and click the gray arrow by the Derived Data folder. Then delete your project folder.)

  • Click delete on the class, remove reference (not Move to Trash), and add it back again. (see this answer)

Solution 2 - Ios

Or if none of the above works, type out the name of the outlet into the file first @IBOutlet weak var headerHeightConstraint: NSLayoutConstraint! and then click and drag from the outlet in the nib to the variable you just programmatically created. It should work without any of the hassle of cleaning, building, and deleting anything.

Solution 3 - Ios

Just perform the two following steps to get rid of this error

  1. Clean project using Product > clean
  2. Run the project

Now try to add the action or outlet. That's it.

Happy Coding

Solution 4 - Ios

None of the tips in the best answer worked for me. Was going crazy. Then noticed that the Assistant Editor had somehow gotten set to Manual and I was on the ViewController.swift (Interface) instead of the ViewController.swift file.

Changed that and problem solved. A bit embarrassing but hey, we are all learning.

enter image description here

Solution 5 - Ios

Here are the steps solved for me:

  1. Remove Class name reference from View(storyboard/xib) and save;
  2. Add Class name again and save;
  3. Clean and Build;

Done !

Solution 6 - Ios

I had the same issue. I tired below solutions but didn’t worked :

  1. Clean Project (cmd + shift + k) and even Clean Project Build (cmd + shift + alt + k)
  2. Deleted Derived data and Module Cache content

Below workaround to this issue :

  1. Move to source code file and write the IBOutlet / IBAction manually (copy paste preferred)

Screenshot 1

  1. Then move to Storyboard file and Open Utilites window
  2. Goto Connection Inspector
  3. Then Connect the IBOutlet and IBAction written in source file with Interface Builder.

Screenshot 2

Solution 7 - Ios

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

Solution 8 - Ios

  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.

Solution 9 - Ios

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.

Solution 10 - Ios

I got this bug when I renamed the class. Then I solved it just by following the below steps

  • In Xcode Menu -> Product -> Clean
  • Restart the Xcode

Solution 11 - Ios

I found an easier workaround as I this bug can be found on XCODE 9.

Step one go to your viewcontroller and manually write the property you want to connect as the below example, make sure you use the below format.

@IBOutlet weak var questionsStackView: UIStackView!

Step two go to your storyboard and connect your view or whatever your trying to connect to the property you created in step 1.

The above will save you time of removing and cleaning derived data.

Solution 12 - Ios

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.

Solution 13 - Ios

In my case this was bc I chose a new UIViewController file in IB and then tried to ctrl-drag to this new controller without first removing the previous connections in the Connections Inspector. Remove those first and try again.

Solution 14 - Ios

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!

Solution 15 - Ios

enter image description here

I selected Automatic option to select the ViewController.swift file. And then I can able to take outlets.

Solution 16 - Ios

None of this worked for me but I did figure this out.

Inside the storyboard I copied the corresponding ViewController into the clipboard and deleted it, afterwards I pasted it again.

Suddenly everything was working like a charm again!

Solution 17 - Ios

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 .

Solution 18 - Ios

Simplest solution:- I used xCode 7 and iOS 9.

in your .m

delete #import "VC.h"

save .m and link your outlet again it work fine.

Solution 19 - Ios

I used xCode 7 and iOS 9.

in your .m

delete #import "VC.h"

save .m and link your outlet again it work fine.

in your .m

add #import "VC.h"

save .m

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEge Kaan GürkanView Question on Stackoverflow
Solution 1 - IosSuragchView Answer on Stackoverflow
Solution 2 - IosStephen PaulView Answer on Stackoverflow
Solution 3 - IosAkshaykumar MaldhureView Answer on Stackoverflow
Solution 4 - IosJoshua DanceView Answer on Stackoverflow
Solution 5 - IosAlmeidaView Answer on Stackoverflow
Solution 6 - IosJayprakash DubeyView Answer on Stackoverflow
Solution 7 - IosVitaliiView Answer on Stackoverflow
Solution 8 - IosAliView Answer on Stackoverflow
Solution 9 - IosKuboAndTwoStringsView Answer on Stackoverflow
Solution 10 - IosVinoth VinoView Answer on Stackoverflow
Solution 11 - IosGyroCocoaView Answer on Stackoverflow
Solution 12 - IosDevendra SinghView Answer on Stackoverflow
Solution 13 - IosMarius WaldalView Answer on Stackoverflow
Solution 14 - IoslmicuView Answer on Stackoverflow
Solution 15 - IosArpit B ParekhView Answer on Stackoverflow
Solution 16 - IosMarkusView Answer on Stackoverflow
Solution 17 - IosroyView Answer on Stackoverflow
Solution 18 - IosAhmed AbdallahView Answer on Stackoverflow
Solution 19 - IosAhmed AbdallahView Answer on Stackoverflow