I just upgraded to Xcode GM 8.0 and noticed ⌘ + / is not commenting out selected lines. Is there another command to comment out multiple lines in Xcode 8?
In Xcode7 and earlier versions, the commenting option was available in Editor > Structure > Comment Selection. In Xcode 8 this option is disabled.
To enable these options run sudo /usr/libexec/xpccachectl
and restart your Mac.
There is thread on Apple Developer Forums regarding this issue and several possible fixes. For me running the above command and restarting the Mac did the fix.
Also in Xcode 8 release note it states:
To use the Editor's Comment/Uncomment Selection and Add Documentation commands—as well as other installed Xcode Extensions—on OS X version 10.11, launch Xcode and install additional system components, then restart your Mac. (26106213)
Sometimes this happens to me (even with Xcode7, and just confirmed still with Xcode8) after opening the documentation window (Help -> Documentation and API Reference or cmd+shift+0). Here are a few things that have fixed it when it was happening to me:
If you have a nested /* anywhere, including in a string, it breaks the XCode comment command. See details here.
Go to Systems Preferences > Keyboard > Shortcuts > App shortcuts and disable Show Help menu option.
That worked for me after try with all possible solutions.
I finally figured this one out, drove me crazy…
These are the preconditions for the bug to arise:
Under these preconditions there is not conflict showing in XCode keyboard preferences, but it trying to invoke cmd+'/' triggers the global help hotkey anyway.
How to fix it?
Simply remap or switch off the global hotkey to show help in system preferences > keyboard > keyboard shortcuts, select app shortcuts in the list on the left.