Thursday, January 24, 2008
Thursday, January 10, 2008
I Did Not Know That
Xcode's Cocoa project templates have 2 occurrences of "#import <Cocoa/Cocoa.h>"- One in the prefix file and one in main.m. The behavior of #import means that only the first occurrence actually matters, but then why would I need the second one in main.m? It turns out that in a monochrome world, I don't. But if you're like me and you use syntax coloring at all, deleting the unnecessary #import in main.m(and any other source files) will leave you with not-so-pretty coloring of all the Cocoa bits.
I'm guilty of deleting the unnecessary #import on general principle, and I'm guessing somebody else out there has done this as well.
Update: I'm now unable to reproduce the syntax coloring problem by deleting the unnecessary #import. However, the problem did exist for myself and others, and was fixed by adding the #import back to a source file. I guess the advice here is: If you have coloring issues and the #import is missing, add it back.
I'm guilty of deleting the unnecessary #import on general principle, and I'm guessing somebody else out there has done this as well.
Update: I'm now unable to reproduce the syntax coloring problem by deleting the unnecessary #import. However, the problem did exist for myself and others, and was fixed by adding the #import back to a source file. I guess the advice here is: If you have coloring issues and the #import is missing, add it back.
Subscribe to:
Posts (Atom)