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.
This is a known bug in Xcode 8 beta-4 (according to Apple, on "some systems", without specifying which ones).
The good news is, according to Apple they've fixed this in beta-5. From the release notes:
The bad news is, it's still not working for me in beta-5, even after rebooting. And for the life of me, I can't figure out what they mean by "when enabled". Since when do you have to "enable" comment/uncomment, and how would you go about doing that?
I'm on a Mac Pro cylinder running El Capitan 10.11.6, editing Swift 2.3 code.
For me it was a little bit of CompSci 101:
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.sudo /usr/libexec/xpccachectl
in TerminalSource
It seems that if you have nested /* anywhere in your code it breaks the commenting from then on. Others have reported that it happens with nested block comments. However if you have nested /* anywhere, including a string it will fail.
Note the following bit of code is working with path characters
/
and wildcards*
that together make/*
. Anything after this line and commenting out doesn't work in XCode.On a German Macintosh Computer, there is a System keyboard shortcut overriding the Xcode comment section shortcut.
Simply deactivate the
Hilfemenü anzeigen
shortcut. (show help)