Ridiculous solutions to problems Part 2

So here is a really annoying one, embarrassingly it had me caught for a couple of hours!

The symptom? You are working on your storyboard, you have a UIViewController with a custom class and a number of outlets for the elements on screen....

But all of a sudden - whenever you add new elements, they don't show up under the outlets section when you click on you UIViewController in the storyboard!!

Removing your current referencing outlet connections makes them dissappear from the list as well. You also don't get the custom class field auto-populated when you try re-entering the name of your custom class.

This caught me out becaue I tried restarting XCode, running a clean, cleaning my build folder (holding option when you click on Product->Clean) and even restarting my computer! Nothing I was doing seemed to be right...but in fact, I was doing all of the right things but in the wrong order!

If you are unlucky enough to hit this seemingly random bug, here is what you have to do.

  1. Clean the build folder (hold option when you click on Product->Clean).
  2. Restart your computer immediately.

Did you have a similar problem but solved it in a different way? Let me know!

Happy coding.