Xcode 6: can't connect any IBOutlet to ViewController

35,972

Solution 1

You can also see that the link between the parent view and the custom class is broken (not visible anymore) which is a huge problem.

I had the exact same issue with the app i'm working on actually, updating XCode from 5.xxx to 6.1. The workaround that worked for me was to remove the reference of every view controller and re-add them to the project...

To everyone facing that issue, here's the (annoying) trick :

  • Step 1 : select both .h and .m view controller files
  • Step 2 : remove the reference of those files
  • Step 3 : re-add the files to your project tree
  • Step 4 : open the storyboard, eventually re-build the project and smile

I can understand those things could be reaaally annoying, but it worked for me... Hope it will help someone else !

Solution 2

In your storyboard hierarchy select the View Controller,

enter image description here

In the right pane Custom Class section Class, select the drop down and your desired view controller.

enter image description here

Solution 3

I've experienced similar behaviour in Xcode 6.1.1 when trying to add the first outlet to a new view.

Tried removing the references and adding the files again as suggested above with no success.

What I did find worked was writing the first property on the new view by hand. I just popped in:

@property NSString *temp;

I could then attach my outlets in the normal way. Just delete the temporary property once you've added your first outlet.

Hope this helps.

Solution 4

Maybe I can help In my case the problem was that the viewController.swift file was not connected to the StoryBoard. The solution is to click in the Upper border of the view on the storyboard beside the 3 icons (View Controller, First Responder and Exit)...now look over in the Utility Area choose Identity Inspector, and in "Custom Class" choose the custom view controller.

Hope this helps. Xcode is hard!!

Solution 5

It seems typing the outlet first (swift):

@IBOutlet weak var someViewOutlet: UIView!

and then dragging from IB the outlet to the far right type in the above code works.

Restarting Xcode resolves the issue (sometimes). Using Xcode 6.1

Share:
35,972
lorenzop
Author by

lorenzop

I am currently studying Computer Security and Resilience (MSc) full time at the University of Newcastle, having completed my bachelor's degree at "La Sapienza" University of Rome, I expect to graduate in summer 2013. I have developed many iOS/Android app.

Updated on July 09, 2022

Comments

  • lorenzop
    lorenzop almost 2 years

    After upgrading to Xcode 6, I opened an old project (that contains a subproject, so it has many targets) and I noticed that no link from my Storyboard ViewContoller to the relative Objects works.

    For example I have a ViewController with a TableView inside and now I cant do can't do anyhing with it because the connection is missing, I can't even redefine a new IBOutlet in the VC because the arrow in the storyboard from the VC won't connect to anything.

    To be more clear:

    screenshot

    The class is defined in the Custom Class section, so I can't find the problem

    screenshot

    What should I do? Btw I'm using obj-c not swift, I found some related answer but all about swift.