为什么 Xcode 4 版本编辑器有时会说“没有编辑器”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5994630/
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
Why does Xcode 4 version editor sometimes say "no editor"
提问by Rayfleck
In the Project Navigator, there is a little "M" next to the project file, meaning it's been modified. So I tap the Version Editor. The left side shows me the contents of the project file, and the right side says "No Editor". Same thing if I go into Source Control, Commit Selected Files...
在项目导航器中,项目文件旁边有一个小“M”,表示它已被修改。所以我点击版本编辑器。左侧显示项目文件的内容,右侧显示“无编辑器”。同样的事情,如果我进入源代码管理,提交选定的文件......
However, other files (.m, .h, .plist, etc.) all show real differences, and correctly check-in changes.
但是,其他文件(.m、.h、.plist 等)都显示出真正的差异,并正确签入更改。
Do I have this mis-configured somehow?
我是否以某种方式配置错误?
回答by David
This happened to me before I updated to Xcode 4.0.2. I think it's a bug. However, try to refresh status by going to File -> Source Control -> Refresh Status
.
这发生在我更新到 Xcode 4.0.2 之前。我认为这是一个错误。但是,请尝试通过转到 刷新状态File -> Source Control -> Refresh Status
。
Also, may be obvious, but make sure you actually select the modified file by clicking it in the source tree.
此外,可能很明显,但请确保通过在源树中单击它来实际选择修改后的文件。
回答by Tony
I had this too, exact same problem.
我也有这个,完全一样的问题。
This is despite the fact that you can be using either the organizer interface, or the command line interface, and they appear fine.
尽管您可以使用管理器界面或命令行界面,但它们看起来都很好。
Until a file has been updated through the Xcode File...Source Control..commit it doesn't recognize the file, and the version editor will appear to not be working.
在通过 Xcode File...Source Control..commit 更新文件之前,它无法识别该文件,并且版本编辑器似乎无法正常工作。
Symptom :The Right pane will show messages like File Added and Unversioned File, and the left pane will only ever show the current local Revision.
症状:右窗格将显示诸如已添加文件和未版本化文件之类的消息,而左窗格将仅显示当前的本地修订版本。
This is particularly odd because the jump bars and timeline will show the other revisions, you just can't get to them.
这特别奇怪,因为跳转条和时间线会显示其他修订版本,您只是无法访问它们。
The Workaround is to make a small edit to each file then use Xcode's File..Source Control..Commit.
解决方法是对每个文件进行小的编辑,然后使用 Xcode 的 File..Source Control..Commit。
Then the files (and their prior revisions) will start showing up in the version editor.
然后文件(及其之前的修订版)将开始显示在版本编辑器中。
回答by Ari Braginsky
Had same problem as well using an SVN repository. It was resolved once I went into the organizer and verified that I could see the revision history of the branch I was working on. I had to hit refresh.
使用 SVN 存储库也有同样的问题。一旦我进入组织者并验证我可以看到我正在处理的分支的修订历史,它就解决了。我不得不点击刷新。
回答by Will Johnston
I had this issue after stashing , changing branch and then unstashing using git/sourcetree.
我在 stashing 后遇到了这个问题,更改了分支,然后使用 git/sourcetree 取消了隐藏。
None of the above worked, but deleting the workspace did. As per this link. Xcode 4 - slow performance
以上都没有奏效,但删除工作区却奏效了。按照这个链接。 Xcode 4 - 性能缓慢
The was on Xcode 4.5
在 Xcode 4.5 上
回答by Max_B
(subversion SCM) Doing an update action in the organizer Repositories pane does resync Xcode and sort out the problem. No need to commit.
(颠覆 SCM)在管理器存储库窗格中执行更新操作会重新同步 Xcode 并解决问题。无需承诺。
回答by Samuel W.
I ran into this "No Editor" problem when I tried to duplicate a project to do some experimentation on by simply selecting the folder and selecting File>Duplicate in the Finder. Xcode didn't like this, and not only did the duplicated project give a "No Editor" problem, but (after erasing the duplicated project) I found that the original project gave a "No Editor" problem whenever I tried to open it.
当我尝试通过简单地选择文件夹并在 Finder 中选择文件>复制来复制项目以进行一些实验时,我遇到了这个“无编辑器”问题。Xcode 不喜欢这样,不仅重复的项目给出了“无编辑器”的问题,而且(在擦除重复的项目后)我发现每次尝试打开原始项目时都会出现“无编辑器”的问题。
My solution was to simply use Time Capsule to restore the project folder to before I caused all of these problems. It worked!
我的解决方案是在我导致所有这些问题之前简单地使用 Time Capsule 将项目文件夹恢复到。有效!
I'm still a bit puzzled about why it worked, though, because the Finder indicated that none of the original project files had been modified as a result of anything I had done. Perhaps there were some invisible files or something that had been changed....
不过,我仍然对它为什么起作用感到有些困惑,因为 Finder 表明我所做的任何事情都没有修改任何原始项目文件。也许有一些不可见的文件或已经改变的东西......
回答by Dittimon
No idea, but for me, I could get back into my project by choosing it from recent files
不知道,但对我来说,我可以通过从最近的文件中选择它来重新进入我的项目
回答by Uwe
Had the same issue with Xcode 7.2.1. I did a 'Product-Clean' and then chose 'Source Control-History' and one of the historic commits by selecting "Show # modified files" AND THEN chose the list icon in the upper left part of window (after the page icon). Now all works fine.
Xcode 7.2.1 也有同样的问题。我做了一个“产品清理”,然后通过选择“显示#修改过的文件”选择“源代码控制历史”和历史提交之一,然后选择窗口左上角的列表图标(在页面图标之后) . 现在一切正常。
回答by gibertoni
I had the same problem with XCode 4.4.1
我在 XCode 4.4.1 上遇到了同样的问题
My Solution: While he showed No Editor on the Version Control View, the top bar was saying "Loading Revision" and had a infinite progression bar. I just double clicked the progression bar and the files were loaded on the editor.
我的解决方案:虽然他在版本控制视图中显示了无编辑器,但顶部栏显示“正在加载修订版”并且有一个无限进度条。我只需双击进度条,文件就会加载到编辑器中。
回答by nerak99
It is possible to set up a local git to act as a source control, This will make your file>Source Control>Commit work.
可以设置一个本地 git 作为源代码控制,这将使您的文件>源代码控制>提交工作。
I think this will go some way to answering your particular problem.
我认为这将在某种程度上回答您的特定问题。
Warning, to pull previous versions you need to come out of XCode (for safety) and use the CLI git.
警告,要拉取以前的版本,您需要退出 XCode(为了安全)并使用 CLI git。
See this for excellent help on this topic.
请参阅此主题以获得有关此主题的出色帮助。