Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

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.

Technical Data:

I am running Xcode 8 with Swift 3.

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 trash with the same name
  • I have checked the connections --> everything is fine

Images:

1. The file inside my editor:

enter image description here

2. Simulator:

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!

like image 386
Mr. Xcoder Avatar asked Sep 10 '16 09:09

Mr. Xcoder


People also ask

What does exclamation mark do in Xcode?

The exclamation mark indicates that the name property of the Person class is defined as an implicitly unwrapped optional. Note that the print statement returns the value of name , not an optional.

Why does my file have a red exclamation mark?

Those icons mean that the files need to be backed up. You can turn them off, if you want to.

What does an exclamation point mean in Swift?

Swift uses exclamation marks to signal both force unwrapping of optionals and explicitly unwrapped optionals.


1 Answers

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.).

1)

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

2)

Then I would also look at the path of 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.

like image 192
Michael Dautermann Avatar answered Oct 21 '22 00:10

Michael Dautermann