Xcode 4 code sense is not working

后端 未结 13 1389
臣服心动
臣服心动 2020-11-30 19:38

I am running a \"old\" Xcode 3 project in Xcode 4 and code sense is not working for my own classes. I have tried following:

  • Clean/rebuild
  • Remove Der
相关标签:
13条回答
  • 2020-11-30 19:45

    Close all xcode windows

    Delete all your projects from xcode>window>organizer and restart your project. It will now sense and index your project properly.

    0 讨论(0)
  • 2020-11-30 19:46

    You can able to fix that issue by change build settings like this, PreCompile Prefix Headers :NO

    0 讨论(0)
  • 2020-11-30 19:48

    It's been ages but the answer is just to move the code into a new folder and the code sense should be working now.

    This happened when I added a new Objective-C Class and the code sense doesn't work only on the newly added .m and .h files (on XCode 4 latest update during this post).

    0 讨论(0)
  • 2020-11-30 19:49

    For me it happened simply because the file had no target membership. If the first few answers did not work for you, go to your .m file (presumably it's this file that you're having trouble with), open the Utilities view (Edit -> Utilities -> Show File Inspector) and under "Target Membership" check the target to which you want this file to belong.

    0 讨论(0)
  • 2020-11-30 19:50

    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.

    0 讨论(0)
  • 2020-11-30 19:54

    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)

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