Mattk90 Mattk90 - 1 year ago 156
Swift Question

Deleted class drops error message unknown>:0: error: no such file or directory:

So me and some friends working on a bitbucket project and already realized that bitbucket sometimes doesn't sync all the files. But here is what happened:

I continued working and created an class, I basically copied an old View Controller (called

WelcomescreenViewController.swift
->
CreateAccountViewController.swift
) and made some adjustments in the main storyboard. Here I deleted all the old outlets in the new one and then made an own class for it as ViewController and connected it with it in the main storyboard.

What now happened is that there were some problems and I reverted everything and deleted both things again. And basically now Xcode still kind of thinks that there should be the class. It always drops the message:

enter image description here

I also made a screenshot from the directory with my files as it is now:

enter image description here

I tried to create the class again, so that Xcode is happy but it doesn't help. Is the file somewhere linked or what shall I do, to teach Xcode hey everything is fine, don't mind about the old file
CreateAccountViewController.swift
?

Answer Source

Make sure in your target settings, under Build Phases > Compile Sources that your file isn't listed there:

enter image description here

Also, just check it somehow hasn't been added to Copy Bundle Resources.

enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download