无法查看 Xcode 4.2 帮助“index.html”被锁定编辑

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8044931/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:21:28  来源:igfitidea点击:

Unable to view Xcode 4.2 help “index.html” is locked for editing

xcode

提问by Sergio

When I try to search the documentation within Xcode I get the following error:

当我尝试在 Xcode 中搜索文档时,出现以下错误:

“index.html” is locked for editing and you may not be able to save your changes. Do you want to unlock it?

“index.html”已锁定编辑,您可能无法保存更改。你想解锁吗?

“index.html” is currently locked because it does not support editing.

“index.html”目前被锁定,因为它不支持编辑。

The file “index.html” could not be unlocked.

无法解锁文件“index.html”。

Could not add write permission to the file because you do not own it. Try modifying the permissions of the file in the Finder or Terminal.

无法向文件添加写入权限,因为您不拥有它。尝试在 Finder 或终端中修改文件的权限。

I have tried uninstalling and reinstalling without success.

我尝试卸载并重新安装但没有成功。

Any ideas?

有任何想法吗?

回答by Michael Dautermann

Here's a solution I found on Apple's DevForums:

这是我在Apple 的 DevForums上找到的解决方案

I went into Xcode preferences, went to the Downloads option, and selected Documentation. From there, I clicked 'Check and Install Now' and it went and downloaded the iOS 5.0 library and 10.7 library. Once those were downloaded, help seemed to be working again via the local libraries. Hope this helps get you back on track.

我进入 Xcode 首选项,进入下载选项,然后选择文档。从那里,我单击“立即检查并安装”,然后下载了 iOS 5.0 库和 10.7 库。下载这些后,帮助似乎可以通过本地图书馆再次发挥作用。希望这有助于让您重回正轨。

And yes, I've seen the same problem that you've seen. You just need to fully download the documentation.

是的,我遇到了和你看到的一样的问题。您只需要完全下载文档。

回答by zaxxon

Update: xCode 4.2.1 fixes this problem.

更新:xCode 4.2.1 修复了这个问题。

回答by Matthew Lowe

I worked around the issue in Snow Leopard this way:

我以这种方式在 Snow Leopard 中解决了这个问题:

  1. Open XCode
  2. Open the organizer ( Window | Organizer )
  3. Select Devices | Provisioning Profiles
  4. Select my phone-provided provisioning profile and click Refresh
  1. 打开 XCode
  2. 打开管理器(窗口 | 管理器)
  3. 选择设备 | 配置文件
  4. 选择我的手机提供的配置文件,然后单击刷新

You do this silly thing because XCode will then display a dialog asking you to sign in with your Apple ID. If I sign in /here/ instead of on the page in the documentation, it remembers I'm signed in, shows the documentation when I ask, and doesn't crash. I have to do this every time I restart XCode, though.

你做了这件傻事,因为 XCode 会显示一个对话框,要求你用你的 Apple ID 登录。如果我在 /here/ 而不是在文档页面上登录,它会记住我已登录,在我询问时显示文档,并且不会崩溃。不过,每次重新启动 XCode 时我都必须这样做。

YMMV.

天啊。

回答by ifredy3

the Better solution is Uninstall Xcode:

更好的解决方案是卸载 Xcode:

sudo /Developer/Library/uninstall-devtools –mode=all

after that, install Xcod

之后,安装Xcod

回答by Daniel Parks

You can chown the documentation to your user, attempt to search, unlock the file, and then chown the documentation back.

您可以将文档公开给您的用户,尝试搜索、解锁文件,然后重新公开文档。

Unfortunately, you have to search and unlock for each file individually.

不幸的是,您必须单独搜索和解锁每个文件。

sudo chown -R `id -un` /Library/Developer/Shared/Documentation/DocSets
# Try to search; unlock the file.
sudo chown -R _devdocs /Library/Developer/Shared/Documentation/DocSets

I don't think it actually modifies the file — I suspect this is a problem with the new versioning feature.

我不认为它实际上修改了文件——我怀疑这是新版本控制功能的问题。

回答by Sergio

This has helped:

这有助于:

Become super user

成为超级用户

% cd /Library/Developer/Shared/Documentation

% cd /Library/Developer/Shared/Documentation

% tcsh

% tcsh

foreach i ( `find . -name index.html` )
  echo $i
  xattr -d com.apple.quarantine $i
end

I still get the following on the first search:

我仍然在第一次搜索时得到以下信息:

Internal Error Xcode encountered an internal logic error. Choose "Continue" to continue running Xcode in an inconsistent state. Choose "Crash" to halt Xcode and file a bug with Crash Reporter. Choosing "Crash" will result in the loss of all unsaved data.

内部错误 Xcode 遇到内部逻辑错误。选择“继续”以在不一致的状态下继续运行 Xcode。选择“崩溃”以停止 Xcode 并使用 Crash Reporter 提交错误。选择“崩溃”将导致所有未保存的数据丢失。

[Show Details] [Continue] [Crash]

[显示详情] [继续] [崩溃]

I pick [Continue] and everything works fine afterwards.

我选择[继续],之后一切正常。

回答by David DelMonte

Simple answer... Have you tried repairing permissions?

简单的答案...您是否尝试过修复权限?

How about deleting xCode prefs?

删除 xCode 首选项怎么样?