Sometimes, it seems I can't comment my code with the usual shortcut (command
+ /
) under Xcode 8 Beta 4. The option is disabled in the menu (screenshot below).
Do you have any idea why? Am I the only one having this issue?
EDIT: It seems to work again after restarting Xcode... Still looking from where it comes. It's a bit annoying...
EDIT2: It still occurs on Xcode 8.1. Maybe because I have 2 versions of Xcode installed (normal and beta)? Can't fix it anymore with a simple restart!
EDIT3: the proposed xpccachectl
command to fix it doesn't exist on MacOS High Sierra.
alt + c then alt + l (holding alt ) for line comment.
By selecting a few lines of code (pressing ⇧+↑ or ⇧+↓), you can comment a bunch of lines in a single shot with the ⌘ + / shortcut. If the lines are already comments, the same shortcut will uncomment them.
Comment and uncomment blocks of codeFrom the main menu, select Code | Comment with Block Comment. Press Ctrl+Shift+/ .
Try this. Out of all the other suggestions, this was the only one that worked for me.
Go to your applications folder and rename Xcode to whatever you want, then open the Xcode. Check to see if the comment selection now works, if so, you can go back and rename Xcode to its default name. If not, rename Xcode back to its original name anyway, and continue searching for another solution.
This worked perfectly for me.
None of the workarounds worked for me after installing xcode 8.1 beta. I finally found that moving the Xcode beta out of the applications folder into a different location (desktop is where i put mine) then running sudo usr/libexec/xpccachectl
fixed the issues i was having.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With