Xcode 项目导航器中的问号是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8525177/
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-09 04:11:50  来源:igfitidea点击:

What Does Question Mark Mean in Xcode Project Navigator?

xcodeversion-control

提问by Kevin_TA

In the project navigator in Xcode, I am not sure what the ? is trying to tell me next to the file name.

在 Xcode 的项目导航器中,我不确定 ? 正试图告诉我旁边的文件名。


Screen Shot


截屏

I am sure it is not a coincidence that this is the same file that I dragged from my root directory for the project to the Classes folder (because the .mm file was there and I wanted them to be together). The project still compiles just fine, however my code sense broke recently and I am wondering whether this may be part of the issue.

我确信这与我从项目的根目录拖到 Classes 文件夹中的文件相同,这并非巧合(因为 .mm 文件在那里并且我希望它们在一起)。该项目仍然编译得很好,但是我的代码意识最近崩溃了,我想知道这是否可能是问题的一部分。

Thanks!

谢谢!

回答by Michael Krelin - hacker

It's the file untracked by source control.

这是源代码管理未跟踪的文件。

回答by da Rocha Pires

Those characters refer to the source control.

这些字符指的是源代码管理。



  • ?- Unversioned
  • M- Modified
  • A- Added
  • A+- Moved / renamed
  • U- Newer version of a file on source control
  • ? - 未版本化
  • M- 修改
  • A- 添加
  • A+- 移动/重命名
  • U- 源代码管理文件的较新版本


More reference here

更多参考这里

回答by bpolat

You can add to source control by selecting the untracked files enter image description here

您可以通过选择未跟踪的文件来添加到源代码管理 在此处输入图片说明

回答by Mugs

Those are uncommitted files if your using GIT, you need to right click Source Control>Commit Selected File manually. It should take away the "?" on the new version of Xcode 6.3.2 as of today

如果您使用 GIT,那些是未提交的文件,您需要右键单击源代码管理>手动提交选定的文件。它应该去掉“?” 截至今天,在新版本的 Xcode 6.3.2 上

回答by Anton Eregin

Following steps resolved issue for me:

以下步骤为我解决了问题:

  • Select all your files with "?"
  • Right click and select Source Control
  • Select Add Selected Files
  • Select Commit Selected Files...
  • On the popup dialog just drop some comment (no matter what=)
  • 用“?”选择所有文件
  • 右键单击并选择源代码管理
  • 选择添加选定的文件
  • 选择提交选定的文件...
  • 在弹出对话框中,只需添加一些评论(无论如何=)

Screen

屏幕

回答by Honey

Along with all other answers. This shouldn't happen by default UNLESS you have changed the settings in Xcode.

连同所有其他答案。除非您更改了 Xcode 中的设置,否则默认情况下不会发生这种情况。

From Xcode Preferences >> Source Control >> make sure 'Add and remove files automatically' is selected

从Xcode预设>>源代码控制>>确保“添加和自动删除文件”被选择

enter image description here

在此处输入图片说明

回答by Igor

I suddenly get one my file Unversioned(with ? mark), but it was old file.

我突然得到一个我的文件Unversioned(带有?标记),但它是旧文件。

It was .m file. Before problem occurred, I created copy of it, for making new similar class. I renamed a class and add new file to XCode.

它是 .m 文件。在问题发生之前,我创建了它的副本,用于创建新的类似类。我重命名了一个类并将新文件添加到 XCode。

Problem (with old file become Unversioned) was in not renamed comment string at beginning:

问题(旧文件变为未版本化)在开头未重命名的注释字符串中:

//
//  MyFirstClass.m

When I renamed it, problem with Unversioned file was resolved.

当我重命名它时,Unversioned 文件的问题解决了。

//
//  MySecondClass.m

Hope it'll helpful somebody.

希望它会帮助某人。

P.S. Additionally maybe needed to remove and copy back this files.

PS另外可能需要删除和复制这些文件。