My project was created in Xcode 3, I\'m opening it in Xcode 4 and notice the following:
In our case the culprit turned out to be old version of the three20 libs. To get the project working I had to:
As soon as the new library was installed, xcode4 automatically reindexed. Code completion, jump to definition and even Refactor all work now. The Joy(tm) of working with Xcode is back! :)
In more general terms, any library that puts it header files into BUILT_PRODUCT_DIR is likely to have similar issues.
On Window Menu:
A little tip from other's answer:
After step.4 don't rebuild the project but just restart Xcode.
I had the same problem in XCode 4 final version today, working with my old XCode 3 project. The problem is related to an index of symbols that XCode creates. It should create a new index for you automatically, but it seems to take a long time in XCode 4. One possible solution is to go to ~/Library/Developer/Xcode/DerivedData and delete the old index. Restart XCode, and you should see it indexing. For 'Jump to Definition', you can hold down command and mouse over a method or class name, and you should see blue underlines, like hyperlinks. Then you can click on it to jump to definition.
I had the very same problem here. No definition links, code sense or syntax highlighting. Removing derived data didn't work and even creating a new project did not make any difference. While it may not be the same problem you have, cleaning up the build settings (so that there are no conflicts between project and targets) like Rick said solved it for me (though I still don't know which setting(s) was/were causing the problem).
What worked for me when i lost xcodes super nice code hinting was:
Window(menu) -> Organizer(menu) -> Projects(tab)
then
Press delete Derived Data (this is the same as going to the folder and deleting it manually)
BUT!!!!! at this step dont rebuild but shut down xcode and reopen of the project. This worked for me.
I don't know if it helps someone, but I got the code indexing of my C++ project broken when I switched to Xcode 4. I haven't switched to Lion so I still have the 4.02 version. When creating the project in Xcode I would use the external build option, this didn't add the HEADER_SEARCH_PATHS correctly to the project. I found that using:
cmake -G Xcode .
to generate the xcode project, sets this variable correctly and enables the indexing of the entire project.