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
Product > Clean (Command - Shift - K) fixed it for me!
Just need to clean and re-build the project.
I tried EVERYTHING!
Make sure the class name of your UIViewController does not contain the word "Test"
Bug Report submitted.
What solved this issue for me was actually deleting the class from the project.
Steps:
This seems to force Xcode to link the class back into the storyboard.
Note: for me the following did not work:
I think this is a bug on Apple's part
In case anyone is still frustrated by this, there's a trick to get things working.
What I do is manually enter an outlet into my class, for example: @IBOutlet weak var someView: UIView!
, and drag from the code to the view in IB or storyboard. After this, I am able to drag from IB / Storyboard to my class to make connections, assistant editors recognizes the class in "Automatic", etc...
Works every time.
If people try the above and things are still not working, the strange trick that worked for me was adding the outlet in a chunk of whitespace. It works if there are no other lines directly above or below the line you're adding. Strange, but it worked!