Xcode 4 autocomplete buggy

前端 未结 5 2445
北荒
北荒 2021-02-19 17:07

do you face also the problems with Xcode 4 autocomplete feature that used to work great on version 3.x.x?

I\'ve imported in the Prefix some classes and Xcode doesn\'t wan

相关标签:
5条回答
  • 2021-02-19 17:19

    I have found that changing compilers, building, and then changing back, and building again works relatively consistently. Wrote a post about it on my blog:

    http://rhappsody.wordpress.com/2011/08/03/xcode-4-code-colouring-and-auto-completion/

    0 讨论(0)
  • 2021-02-19 17:23

    I've faced the same issued as soon as I moved to XCode4. What I realised was that I needed to install iOS's documentation to have the code completion fully working.

    Go to Xcode -> Preferences -> Documentation and click GET on the iOS 4.3 Documentation. In the iTunes-style status window, the download progress will be shown.

    0 讨论(0)
  • 2021-02-19 17:29

    I found that sometimes the autocompletion gets broken when dealing with stuff defined in the prefix header. One way to get Xcode to index those again correctly is to use the touch command in the Terminal, e.g.:

    touch /Users/someguy/Document/Foo-App/Foo-Prefix.pch
    

    Or add a new line to the prefix for the same effect. Xcode then gets busy reindexing and things work again.

    0 讨论(0)
  • 2021-02-19 17:41

    EDIT 3: Note that this indexing issues has mostly disappeared in recent versions of Xcode (4.1 for sure, latest pre-Lion 4.0.x I think), and that I do not use this workaround anymore, using pch... And in fact not using Xcode anymore... AppCode ftw! :)


    An easy, but quite dirty workaround imho is not using precompiled header .pch file to do global includes, but instead go a global header .h, that you include... everywhere. That way indexing will work flawlessly...

    I Know that's dirty, don't downvote me please :) I'll delete this answer as soon as someone propose something better! Which I would love.

    Off-topic, but related, read somewhere llvm2 is not supposed to get a gain speed with .pch files. which kind of deprecate them.

    EDIT: Just checked to be sure of my answer, latest version of Xcode (4.0.1 when writing this) looks like fixing that bug for me. Did you upgrade to latest version?

    EDIT 2: Removed my global import header .h, all its references, and moved my global imports into .pch file... That doesn't work as well I expected, latest Xcode 4.0.1 improved on this part but still have some cases where it fails. (I'm working on a project with hundreds of files). Looks like cleaning index/restarting Xcode fix it. I might consider reverting to my dirty workaround...

    0 讨论(0)
  • 2021-02-19 17:42

    I was able to correct this issue by setting Precompile Prefix Header to No in the build settings.

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