Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Xcode 6 - view controller does not have an outlet named (subview)

I just got this error in one of my apps, and after checking some other apps the same error is happening. None of my IBOutlets and IBActions are connected anymore. When I recreate the outlet by control-dragging into the .h file, the outlet still displays the error in Connections Inspector > Outlets, saying (view controller) does not have an outlet named (subview). Before today I didn't have this problem, so is to do with Xcode 6? The view controller is referencing the correct class under Identity Inspector > Custom Class. I have deleted the derived data folder, removed the reference to the .h file, cleaned the project, and cleaned the build folder. None of that has worked and I can't progress with development until this issue is fixed.

Outlets show exclamation mark. Note 'easyLabel'

I disconnect easyLabel, and the outlet disappears. I can't reconnect it with drag and drop.

Update: I just reopened the project after a couple of days and my outlets no longer have the exclamation mark next to them, and the 'easyLabel' outlet that I disconnected has reappeared. I didn't change anything, so I guess it's a bug in Xcode 6-6.1.

Update 2: This error came back. Exclamation marks next to every outlet. If I delete them I can't re-add them. Can't create new outlets. Also can't give a view controller a custom class. I really just want to make some progress on an app, but this issue keeps recurring. Really just can't stand it anymore. Any help would be appreciated.

like image 877
Dale Townsend Avatar asked Sep 19 '14 10:09

Dale Townsend


3 Answers

Duplicate of: Xcode 6: can't connect any IBOutlet to ViewController but here's the trick:

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... Unfortunately, in some cases, mine actually, all the connections get lost again when XCode is closed.

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 !

like image 143
Jerome Avatar answered Nov 12 '22 04:11

Jerome


I had the exact same problem and what was breaking my storyboards was the fact that my project was inside the folder /Dropbox (MyName)/projects/

Apparently something about the name of the dropbox folder with spaces and ( ) was BREAKING my storyboard completely, try what I did and move your project completely to another folder and see if that helps :)

like image 7
Salvador Mosti Avatar answered Nov 12 '22 03:11

Salvador Mosti


I had the same problem, changed the class under identity Inspector > Custom Class to something else, saved it and then set it again to the correct one, after doing that the connections appeared normally.

like image 5
fizampou Avatar answered Nov 12 '22 05:11

fizampou