Xcode Add Document 注释失效解决方法

本文介绍了一种解决Xcode中AddDocumentation快捷键失效的方法。通过重命名Xcode应用程序,可以重新激活该功能,提高开发效率。

前言:注释清晰,增加代码可读性,是每个开发人员都应该做的事情


升级Xcode后发现Add Document的快捷键不能用(一般是:command + option + /),在Editor -> Strutrue看到Add documention是灰色的,不可点。

  • 尝试过以下命令,重启,依旧不行
sudo /usr/libexec/xpccachectl
  • 这是另外一种方法,亲测可行
-> 关闭xcode,打开终端;
-> cd /Applications && mv Xcode.app Xcode_2.app
-> 打开xcode,再次关闭xcode,在终端输入:
-> cd /Applications && mv Xcode_2.app Xcode.app
-> 重启xcode,可看到Add documention已经是可选状态了

注:如果步骤二提示打不开,没有关系,多尝试重复以上步骤,本人第一次执行完以上所有步骤不成功,第二次可以了

<?php // 设置时区为北京时间 date_default_timezone_set('Asia/Shanghai'); // 设置内容类型和编码 header('Content-Type: text/html; charset=utf-8'); // 移除X-Frame-Options,避免拦截iframe加载 header_remove('X-Frame-Options'); // 【临时注释掉 Content-Security-Policy】 header("Content-Security-Policy: frame-ancestors 'self' https://e.hzcl.org.cn"); // 禁止缓存,方便调试 header('Cache-Control: no-store, no-cache, must-revalidate'); header('Pragma: no-cache'); // 限制脚本最大执行时间,防止死循环卡死 set_time_limit(5); // 关闭错误显示,避免页面错乱 ini_set('display_errors', 0); error_reporting(0); // 清空输出缓冲 while (ob_get_level()) { ob_end_clean(); } ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <title>移动App WebView 测试页面</title> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> <style> body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 20px; line-height: 1.6; background-color: #fafafa; color: #333; } </style> </head> <body> <h1>移动App WebView测试页面</h1> <p>欢迎使用移动App环境中的WebView测试页面。</p> <p>允许来自 https://e.hzcl.org.cn 的页面以iframe形式嵌入。</p> <p>当前服务器时间:<?= date('Y-m-d H:i:s') ?></p> <script> console.log("页面已加载:移动App WebView测试页面"); setTimeout(() => { document.body.style.backgroundColor = "#e0f7fa"; const p = document.createElement("p"); p.textContent = "动态内容:页面渲染正常。"; document.body.appendChild(p); }, 1000); </script> </body> </html> 安卓能访问,为啥苹果不能访问
06-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值