Can't comment selection

后端 未结 15 1304
暖寄归人
暖寄归人 2020-12-22 22:19

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 (screen

15条回答
  •  甜味超标
    2020-12-22 22:54

    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.

    int foo = "this line can be commented out";
    
    predicate = [NSPredicate predicateWithFormat:@"(cachedAudioDataURL like '*/Library/Private*/*')) AND (NOT (cachedAudioDataURL like '*/Documents/*'))"];
    
    int bar = "broken - can't be commented out";
    

提交回复
热议问题