PDA

View Full Version : XCode - Bulk Commenting




Fontano
Sep 1, 2008, 08:17 PM
Continuing my conversion from Visual Studio to XCode...

Is there a way to highlight a bunch of rows, and bulk comment/uncomment them?

So if I want to block an entire section of code during debugging or trying things out, I can do it quickly and in blocks.



lee1210
Sep 1, 2008, 08:29 PM
The scripts menu (It looks like a scroll being unrolled), under Comments, there is Un/Comment selection. it is bound to Apple+/ (in my version, at least).

I didn't know this until I looked it up, but I rarely use XCode.

-Lee

Fontano
Sep 1, 2008, 11:11 PM
The scripts menu (It looks like a scroll being unrolled), under Comments, there is Un/Comment selection. it is bound to Apple+/ (in my version, at least).

I didn't know this until I looked it up, but I rarely use XCode.

-Lee

Two questions...

-) Where did you look it up at (so I can look for other things in the future)
-) What do you normally use then?

lee1210
Sep 1, 2008, 11:23 PM
Two questions...

-) Where did you look it up at (so I can look for other things in the future)
-) What do you normally use then?

googled something like "XCode block comments" and found something in apple's mailing list archives. This really should be easier and the information should be easier to come by. I am not sure if this is in the XCode help.

95% of the time at work I am writing C and Fortran in vi, compiling using make with gcc and g95. The rest is in Java in Eclipse, though I am trying to push for more of that. I like the commandline best, but prefer Java to Fortran.

For hobby programming it's about 50/50 between vi and gcc/g++/javac vs XCode for Objective-C.

-Lee

HiRez
Sep 2, 2008, 12:47 AM
Command-forward slash is correct (and will also toggle to uncomment blocks).

Another one you might find useful is Command-[ and Command-] to indent blocks of code left or right.

gnasher729
Sep 2, 2008, 03:29 AM
Continuing my conversion from Visual Studio to XCode...

Is there a way to highlight a bunch of rows, and bulk comment/uncomment them?

So if I want to block an entire section of code during debugging or trying things out, I can do it quickly and in blocks.

#if 0 / #endif