This bug has been driving me nuts since I started using Xcode (4.6.3). Whenever I try to link a Storyboard item to my code, I get the error:
Could not
Select the ViewController in storyBoard, delete current value in Right hand panel/"Customer class"/"class" then re-add control class (type: "SampleViewController"...), enter. --> That work for me
Delete the files (only the references) and add the files again.
This worked for me:
On a side note, I am not sure if this helped but I also deleted the Derived data before performing the above steps (Xcode preferences > Locations)
As I commented on @ChrisHarrison's answer, those things did not work for me, but deleting the derived data as in I got it to work by deleting the derived data as in https://stackoverflow.com/a/16182672/1449799
I would try to remake the .m and .h files in question and give them an original name, not generic like "ViewController". Try something more along the lines of what you want that file to do, and ending in View Controller (i.e. "PizzaDecoraterViewController")
Then select the ViewController that you want to connect to those files. Make sure that you select the ViewController, not just an object within. Click the black bar at the bottom (the one that has the "First Responder" and "Exit" icons). The entire ViewController should outline blue. Then go to the Custom Class section in the Identity Inspector and you should see a grayed out "UIViewController" in the first field. In that field, type in the name of the .h or .m file that you want it to connect to (Start typing PizzaDecorator... and it should do a little auto-complete thing). Then hit ENTER.
When you open up the Assistant Editor, make sure that the file that you are trying to drag and drop to is, in fact, the correct file.
If you have done all as said above, then it should work.
Usually when this happens to me I just haven't saved the code for the class yet. Just hop over to the code and hit cmd+s and it often fixes the problem right way.