What’s Stopping Me?

Well, I’d like to offer up a blog post regaling the world with what I’ve learned from CodeWithChris today, but I can’t. Today was a case of some enforced learning about the Mac mini.

Today, the Mac mini took it upon itself to do … nothing.

After watching Chris’ video this morning, and doing some Xcode playground work, I then moved onto the challenge. Then Xcode decided it would take an absolute age to do anything and, when it finally did do something … it just threw up an error about taking too long to do nothing.

I put it down to the Mac mini being so old that I’ve got to expect it to just be slow. But not being able to get it to display what the code was supposed to display meant that I was stopped in my tracks.

That was until I hit the Internet to see if anyone had any solutions.

Turns out there is a solution. It’s called the DerivedDataDance. Apparently, Xcode has a habit of clogging up the ‘Derived Data’ folder and this hampers performance to such a degree that the Mac just gives up.

It would have been nice to know about this before wasting the entire afternoon waiting on nothing.

Today I learned … the DerivedData.Dance, re:

  1. Quit Xcode
  2. Open Finder, Go menu, select Go to Folder …
  3. Navigate to ~/Library/Developer/Xcode
  4. Delete the DerivedData folder (Move to Trash)
  5. Restart Xcode.

Just posting the steps here for the next time I need to delete it. Turns out that this folder had about 4GB of files in it.

Sure enough, once this folder had been deleted, Xcode got back to working again. Okay, it did take 20 minutes from opening a project to showing the preview but this is an old Mac mini. I don’t mind it taking its time, I do mind it taking forever and then just throwing a wobbly.

I guess I shall be concluding today’s lesson tomorrow now. Thanks, Xcode!