Xcode 4 code sense is not working

Try this:

Open Organizer then Project Tab.

Clear the "Derived Data". Xcode should re-index your project then and code sense should work. At least worked for me.


I know this is late, but for reference: http://sealedabstract.com/code/when-xcode-4s-code-completion-autocomplete-breaks/

  • Close the project, leaving XCode still running.

  • Open XCode’s Organizer window, go to the Projects Tab, select the correct project, and hit the Delete button next to “Derived Data”.

  • Quit XCode.

  • Navigate to your project’s .xcodeproject file in Finder. Right-click, choose “Show Package Contents.”

  • Leave the project.pbxproj file, but delete the project.xcworkspace file, any .pbxuser files, and the entire userdata folder.

  • Open the project in XCode. You will see XCode riding high on the CPU usage for around 10-60 seconds, depending on the size of your project. The activity window will say “Indexing”

  • When your CPU spike returns to earth, code completion will be working again.

There's a lot of deleting going on there so please be careful, but this definitely worked for me.


I've been doing this, and it's worked multiple times for me (after trying all of the above previously).

Edit: Now I just hit space, backspace (the mac version) and rebuild... works nice. Then, remember to scroll (sometimes the colors don't show up until you scroll somewhere)

  1. Find your prefix file: "ProjectName_prefix.pch".
  2. Comment out some line. (basically change it)
  3. Build your project, doesn't matter if it fails or not.
  4. Uncomment it.
  5. Build again.

I'm betting only step 2 (modify the prefix) is what does it, but these essentially get you back to running. Suddenly everything magically recolors itself and completes functions.

Good luck if that doesn't fix it, perhaps try doing this to your dependency pch files (three20 or FB api's)