1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

XCode - Bulk Commenting

Discussion in 'Mac Programming' started by Fontano, Sep 1, 2008.

  1. macrumors member

    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.
  2. macrumors 68040


    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.

  3. macrumors member

    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?
  4. macrumors 68040


    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.

  5. macrumors 601


    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.
  6. macrumors G5


    #if 0 / #endif

Share This Page