Mac XCode - Bulk Commenting

Fontano

macrumors member
Original poster
Jun 27, 2008
72
0
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

macrumors 68040
Jan 10, 2005
3,180
1
Dallas, TX
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

macrumors member
Original poster
Jun 27, 2008
72
0
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

macrumors 68040
Jan 10, 2005
3,180
1
Dallas, TX
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

macrumors 603
Jan 6, 2004
5,812
1,726
Western US
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

macrumors P6
Nov 25, 2005
16,535
3,132
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