Search code examples
objective-cxcodexcode7code-completionxcode7.3

Xcode Objective-C code completion broken for a single file


My Objective-C code completion got broken for a single file in a big project that I'm working on.

There are many classes and completion if just file. But for a new file that I've created, code completion is not working:

enter image description here

Where is, for instance, UINavigationController? The code compiles and works fine though.

I have already:

  • Cleaned the project
  • Rebuilt the project
  • Restarted Xcode
  • Tried above steps a couple of times in different order
  • Removed DerivedData's contents (when Xcode is closed)
  • Removed xcuserdata folder from my workspace "file" (when Xcode is closed)

But it doesn't seem to work. My only observation is that, there was another class with the same name (which I completely forgot) when I created my class (it was in another folder though the same class name and the same project), and as soon as I've realized that it's not compiling due to that old class that wasn't used, I've remove the old one and my code started compiling successfully. I've done all the steps above after removing that class, so nothing should be left of it anyway.

Interestingly, syntax coloring is working properly even though not completing.

How can I get my code completion back on this file? I'm on Xcode 7.3.1.


Solution

  • I have no idea why, but it went away by itself after a few minutes.