3

Possible Duplicate:
xcode code sense color/completion not working
Code loses syntax color in Xcode 4

In my project, some files have syntax coloring and completions, but in some files (both .h and .m), it's not working. Any ideas?

Community
  • 1
  • 1
samir
  • 4,501
  • 6
  • 49
  • 76
  • possible duplicates: http://stackoverflow.com/questions/5288697/code-loses-syntax-color-in-xcode-4 and http://stackoverflow.com/questions/1627033/xcode-code-sense-color-completion-not-working – Michael Jun 26 '12 at 12:33

2 Answers2

4

Go to your organizer and in the projects tab find your project and click "Delete Derived Data" this forces XCode to reindex everything and does not hurt anything. It usually does the trick for me although sometimes XCode is just troublesome.

Dancreek
  • 9,524
  • 1
  • 31
  • 34
  • 5
    "Sometimes Xcode is just troublesome." Amen to that. – Almo Jun 26 '12 at 15:05
  • 1
    Deleting the derived data folder may cure the symptoms, but if you want to fix the underlying cause... see this answer here for complete solution - http://stackoverflow.com/a/10245076/123632 – Ashley Mills Jun 26 '12 at 22:17
  • This didn't work for me. But when I deleted the file and restored it from trash I got all colours back. – klm123 Apr 27 '15 at 15:14
2

Either those files are newly created files and you forgot to add them to a target (your app's target) to them while adding them to your project or it's Xcode's usual index problems.

For case 1:

Select one of those unindexed files and open the File Inspector. Below on target membership, check the box of your target. Clean and build. Restarting Xcode won't hurt.

For case 2:

Refer to Dancreek's answer.

Community
  • 1
  • 1
Eren Beşel
  • 1,047
  • 8
  • 16