Issue with code autocompletion / syntax highlighting in Xcode 4.x

后端 未结 8 1376
说谎
说谎 2020-11-28 05:49

I am having a rather strange issue in Xcode on one of my projects.

When I start to write my code, I am used to the auto-completion suggesting numerous entries for me

相关标签:
8条回答
  • 2020-11-28 06:02

    Still happens to me occasionally on Xcode 4.3.2,

    I simply do this:

    Xcode > Organiser > Projects > Select your project > Derived Data > Click the delete button

    This also deletes the indexing. I then usually restart Xcode and it starts re-indexing, and I get my syntax highlighting and autocompletion back again. (I don't even always restart Xcode - but an excuse to have a break from starting at a screen for hours is always a good thing for your glazballs!)

    It happens that rarely, that this is relatively painless.

    0 讨论(0)
  • 2020-11-28 06:05

    Search for 'GCC_INCREASE_PRECOMPILED_HEADER_SHARING' in build settings and change it to YES. - This worked for me.

    GCC_INCREASE_PRECOMPILED_HEADER_SHARING

    0 讨论(0)
  • 2020-11-28 06:07

    Most of the time I run into this problem deleting the DerivedData fixes it for me, but it one case it didn't. Turns I failed to connect the source file I created to any particular target. Once I connected it to a target source highlighting started working. If other solutions don't work, this might be your issue.

    0 讨论(0)
  • 2020-11-28 06:08

    What the hell was that? I was not receiving any File not found error from the compiler. Fixed that one by removing some missing file links from UnitTest and UITestTarget from Compiler Sources on Project's Build Phases.

    0 讨论(0)
  • 2020-11-28 06:10

    Its really embarrassing. By mistake I took off the Check mark in the Xcode Preferences> Text Editing> Code Completion and I tried every possible solution of that.

    Please check this preference also before digging into any other solution:

    Xcode autocomplete preference

    0 讨论(0)
  • 2020-11-28 06:13

    You may be able to fix this problem by:

    1. Commenting out all entries in the project's .pch file (normally when you do it, Xcode will pick autocompletion now)
    2. Cleaning the project
    3. Uncommening .pch file back
    4. Rebuilding project

    Now you should be able to see correct syntax highlighting and auto completions should be correct.

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