I had the same problem with a project that was good in Xcode 3, and for which syntax highlighting and code completion broke in Xcode 4. I needed better than half a day to figure this out, but I found that the following steps will reproduce / fix The problem is 100% for me.
After all of the above solutions were unsuccessful, I tried to create a project from scratch and carefully redraw all the files and folders. Every time I imported a couple of files that I checked, and the syntax highlighting still worked. Even after the last few of them, it's all the same. Then I hit the assembly, which failed because I forgot to include a couple of common header files in the .pch project file that were there in the old project. And then CodeSense broke again.
After further research, we found that if you import a header file, which, in turn, imports the same environment header file as .pch already does, then CodeSense will break. The same setup did not cause any problems in Xcode 3.
Example:
project.pch
#import <Foundation/Foundation.h> #import "projectConfig.h"
projectConfig.h
#import <Foundation/Foundation.h> #import "one.h" #import "two.h"
So, removing completely unnecessary
#import <Foundation/Foundation.h>
directive "projectConfig.h" you can fix the selection, and the completion of the code will return for you. If your problem is the same as mine.
rage May 17 '11 at 15:13 2011-05-17 15:13
source share