Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 code loses syntax coloring when importing project from Xcode 3

I have just upgraded to the new Xcode 4 and the code is not colored has it should be. I am trying to use a project that I created on Xcode 3.

For instance, the string 'NSString' is not colored in my custom code, but when I switch to Apple's code (NSString.h for ex.) everything is well colored.

How can I fix that?

Thanks a lot, Martin

like image 768
MartinMoizard Avatar asked Mar 19 '11 22:03

MartinMoizard


3 Answers

Open the Organizer (Window > Organizer) and select the Projects mode. Select your project in the left-hand view and then click the Delete… button for the project's Derived Data.

This will delete the code sense index for the project and force Xcode to rebuild the index, which should fix the problem.

like image 183
Rob Keniger Avatar answered Oct 27 '22 18:10

Rob Keniger


I got it to work by prefixing all my project search paths with "$(SOURCE_ROOT)/" instead of just using a project relative path. Eg "Include" becomes "$(SOURCE_ROOT)/Include".

Do this and then force a rebuild of the index by deleting the projects derived data from the organizer.

like image 43
Fredrik Avatar answered Oct 27 '22 17:10

Fredrik


After trying most, if not all, of the steps above, I have succeeded in restoring my colorful Xcode eye candy by finding and deleting (in Finder) all of the derived data created from my project (there were several folders for my project that were lingering even after deletion from the Window > Organizer menu).

My project's folders that needed deletion were located in ~Library/Developer/Xcode/DerivedData

like image 1
Tyler White Avatar answered Oct 27 '22 17:10

Tyler White