20

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!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mr. Xcoder
  • 4,719
  • 5
  • 26
  • 44
  • is there any problem you facing with that .. ? – vaibhav Sep 10 '16 at 09:29
  • 1
    @vaibhav No, but I am really interested to find out what it means, I don't like letting things as they are if I don't understand their meaning. I might get issues with that in the future, it might be something I really need to pay attention to... I might get errors at some point if I am missing something... – Mr. Xcoder Sep 10 '16 at 09:30

1 Answers1

13

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.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • is it saved on a remote server? is it a github repository or a bitbucket repository or something else? – Michael Dautermann Sep 10 '16 at 10:18
  • awwwww... thanks Xcoder. It sounds like something got corrupted in your local `.git` folder (where your source lives). I do recommend saving your files wherever you can, especially remotely, because in case your computer catches on fire or something else disastrous happens, you will have a remote backup that you can retrieve your files from. You wouldn't want to lose work that your bosses pay you for, after all. – Michael Dautermann Sep 10 '16 at 10:28
  • And I did catch your comment about your age and experience :-) You definitely will still want to keep your work somewhere else outside of your house, whenever you have the first opportunity (and a little bit of money in your pocket to pay for the service). Good luck! – Michael Dautermann Sep 10 '16 at 10:30
  • Thanks! I have saved my project to my private github. – Mr. Xcoder Sep 10 '16 at 10:30