Xcode 4: Auto-complete & Jump to Definition broken in my Xcode 3 Project

前端 未结 15 962
时光说笑
时光说笑 2021-01-30 09:11

My project was created in Xcode 3, I\'m opening it in Xcode 4 and notice the following:

  • \'Jump to Definition\' no longer works with my own symbols
相关标签:
15条回答
  • 2021-01-30 09:14

    In our case the culprit turned out to be old version of the three20 libs. To get the project working I had to:

    1. Remove all references to three20 from the project
    2. Follow the instructions at http://three20.info/article/2011-03-10-Xcode4-Support

    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.

    0 讨论(0)
  • 2021-01-30 09:14

    On Window Menu:

    1. Organizer
    2. Projects tab
    3. Your Project
    4. Delete Derived Data
    5. Restart Xcode

    A little tip from other's answer:

    After step.4 don't rebuild the project but just restart Xcode.

    0 讨论(0)
  • 2021-01-30 09:14

    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.

    0 讨论(0)
  • 2021-01-30 09:14

    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).

    0 讨论(0)
  • 2021-01-30 09:20

    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.

    0 讨论(0)
  • 2021-01-30 09:22

    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.

    0 讨论(0)
提交回复
热议问题