xcode '!' 是什么意思 (感叹号)旁边的文件名代表在Xcode

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

What does '!' (exclamation mark) next to the file name represent in Xcode

xcode

提问by Mr. Xcoder

Issue:

问题:

I am wondering what does '!' (exclamation mark), next to the name of the file mean in Xcode. I know that it is meant to tell you that a file is "Missing", but I couldn't find any online explanation. And I also need a way to fix it. I can edit the code inside of the so-called "Missing"file. When I run it into the simulator everything works completely fine, no error and not even a warning.

我想知道什么是“!” (感叹号), 文件名旁边的意思是Xcode。我知道这是为了告诉您文件“丢失”,但我在网上找不到任何解释。而且我还需要一种方法来解决它。我可以编辑所谓的“缺失”文件中的代码。当我将它运行到模拟器中时,一切正常,没有错误,甚至没有警告。

Technical Data:

技术数据:

I am running Xcode 8with Swift 3.

我正在使用Swift 3运行Xcode 8

What I have tried so far:

到目前为止我尝试过的:

  • I tried re-opening Xcode--> didn't work
  • I tried solving it with source-control--> nothing happened
  • I searched for it inside my trash--> no file inside the trashwith the same name
  • I have checked the connections--> everything is fine
  • 我尝试重新打开Xcode--> 没有用
  • 我尝试用源代码控制解决它--> 什么也没发生
  • 我搜索了它在我里面的垃圾- >里面没有文件垃圾具有相同名称
  • 我检查了连接-->一切正常

Images:

图片:

1. The file inside my editor:

1.我的编辑器里面的文件:

enter image description here

在此处输入图片说明

2. Simulator:

2.模拟器:

enter image description here

在此处输入图片说明

Code:

代码:

import Foundation
import UIKit

class Documentation: UIViewController {

    @IBOutlet weak var Basics: UIButton!
    let defaults = UserDefaults.standard

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
        let menuButton = UIBarButtonItem(barButtonSystemItem: .organize, target: self.revealViewController(), action: #selector(SWRevealViewController.revealToggle(_:)))
        menuButton.tintColor = UIColor.white
        self.navigationItem.leftBarButtonItem = menuButton
        self.customizeButton(button: Basics, angle: 50, borderWidth: 2, borderColor: #colorLiteral(red: 0.0693108514, green: 0, blue: 0.2353696823, alpha: 1))

    }
    @IBAction func BasicsAction(_ sender: UIButton) {

    }

    func customizeButton(button: UIButton, angle: Int, borderWidth: Int, borderColor: UIColor){
        button.layer.cornerRadius = CGFloat(angle)
        button.layer.borderWidth = CGFloat(borderWidth)
        button.layer.borderColor = borderColor.cgColor
        let completionLabel = button.viewWithTag(1) as! UILabel!
        completionLabel?.text = "0/10"
        if defaults.value(forKey: "\(button.currentTitle)") != nil{
            let done = defaults.value(forKey: "\(button.currentTitle)") as! Int
            completionLabel?.text = "\(done)/10"
            if done == 10{
                button.layer.borderColor = #colorLiteral(red: 0.2193539292, green: 0.4209204912, blue: 0.1073316187, alpha: 1).cgColor
                button.layer.borderWidth = 5
            }
        }

    }
}

Any help is greatly appreciated if it comes with a good explanation!

如果有很好的解释,任何帮助将不胜感激!

采纳答案by Michael Dautermann

Since the "M" and "A" and "!" are referring to your repositories, I suspect that this file lives on your local drive but, for some reason, isn't found in wherever you are keeping your files remotely (GitHub, BitBucket, Subversion, etc.).

由于“ M”和“ A”和“ !”指的是您的存储库,我怀疑该文件位于您的本地驱动器上,但由于某种原因,在您远程保存文件的任何位置(GitHub、BitBucket、Subversion)中都找不到, 等等。)。

1)

1)

If this were my problem, I'd look on your remote repository first to make sure the file exists there.

如果这是我的问题,我会先查看您的远程存储库以确保该文件存在于那里。

2)

2)

Then I would also look at the pathof the local file. Sure you can open it from your project/workspace, but perhaps it's in a different place/folder than all of the other source files.

然后我还会查看本地文件的路径。当然您可以从您的项目/工作区打开它,但它可能与所有其他源文件位于不同的位置/文件夹中。