So you’re coding away, everything is coloured nicely so you can distinguish between reserved words, datatypes and variables, but then the unthinkable happens; all your code turns black. Not to worry, you can live without the colours, but when you see the “symbol not found” message and Xcode is no longer autocompleting variables and functions for you, you start the panic. Your development time rolls to a halt and you can no longer quickly jump around from method to method. You realise Xcode has broken it’s intellisense index.
You may scoff, but when this happens you realise how awesome intellisense is and how much it actually speeds up development time if you know how to harness all it’s capabilities.
Bringing it back can be simple, but it can also be gruelling depending on just how broken it is. I will run through a few methods to bring it back, sorted from easiest to hardest.
- Quit Xcode. Yep, just quit it and reopen, it may just work
- Do a clean. Push command + shift + K or use the Product > Clean menu item. The next time you build everything will be built from scratch, and could bring intellisense back to life
- Delete the derived data for the project. Open the organizer by pushing command + shift + 2 or the Window > Organizer menu item and under the Projects tab locate your project on the left, there’s a button for derived data. This will trash your intellisense index database and force Xcode to regenerate it. In theory this should always work, but if it doesn’t (which it hasn’t for me on various occasions) then brace yourself, the next one is not for the faint of heart
- Create a new project and move all your source, interface builder and resource files across. This should be your last resort, and very painful
If you know of any other methods, share them below