Is there a shortcut to make a block comment in Xcode?

limp_chimp picture limp_chimp · Nov 3, 2012 · Viewed 171.6k times · Source

I'm writing ANSI-compatible C code, and hence I can't use the line (//) comment. I'm using Xcode. In Sublime Text and Eclipse, and I think most other IDEs, there are separate keyboard shortcuts for line comments and block comments (/**/). However, I don't see that in Xcode - in fact, I don't even see a menu option to add a block comment. Is it simply not supported in Xcode? That would certainly seem to be a lame decision if so.

Answer

Stefan Vasiljevic picture Stefan Vasiljevic · Apr 16, 2013

Try command + /. It works for me.

So, you just highlight the block of code you want to comment out and press those two keys.