Can't delete file in XCode from project - xcode

After updating XCode, I was unable to delete files from project.
I press "Move to trash", and nothing happenes.
I still can access to file in project tree.
How can I do that?
Maybe, I need to check some options?
Please, help me.

Related

Why can't I delete this file from my Xcode project?

Being new to Xcode, I foolishly added "wrong_answer.mp3" via "add files to.." to my project and in the wrong place, but I cannot remove this reference from my project. I deleted the underlying file from the file system, but I cannot find in Xcode where I can remove this reference... Can someone advise how to remove this reference from my project ?
UPDATE: Yes, I have tried delete/backspace and edit menu "Delete".
Some options
Restart Xcode
Clean project, Product—>Clean
Put the file back and delete it from Xcode

How to delete a CLion project

I've been using CLion to run C++ files. Everything has gone well until today, when I accidentally created a project in the wrong folder. I deleted all of the files for the project, but for some reason, CLion still thinks the project exists. How should I fully delete the project? Thanks in advance guys.
Do you mean that when you first launch it and you see the projects on the left side that it's listed there? You can hover over it and press DELETE to remove from the project from that list.

Accidentally deleted file in Xcode

I accidentally had one of my files selected in a project in Xcode and pushed delete and it was deleted. Anyone know how to recover it? It won't let me undo. Please help.
The file itself is not deleted, it is simply removed from the Project Navigator.
To add it back, go to
File -> Add files to "projectName"
and select the missing file, after having navigated to the project's folder if needed.
Or simply hit cmd+z
May be its too late but for someone else it might be good to know, that's why I am answering it.
Go to File >>> Add Files'Your Project Name' there will be a list of all files which have been removed from project, select and add them back.
Now these files are back in project, but they don't have any reference yet so xCode will give you error saying "Storyboard do not have any file of this name", now you have to add references, for this just right click on that missing files and add that file to project.
NOTE: If you have removed files directly to trash then restore from trash and repeat second step to add reference back in project.
This file should be in the trash folder, look in that folder or you can search via apple spotlight.
The following steps will allow you to recover (a) deleted file(s):
Click on the trash icon on the bottom right
Search for the file(s) and move it back into your project folder
In XCode, go to File, Add Files to ..., then select the file(s) you've just restored
There are some files that XCode deletes utterly without warning. These files are permanently deleted unless you have a backup.

Xcode indexing does not finish

I am having a small project just for testing. After a few days of testing the "indexing process" of Xcode broke, it simply does not finish. I tried it with another project, same thing. I tried to reinstall Xcode -> Did not help, I deleted the Derived Data -> Did not help. Restarting Mac + Xcode -> Did not help. Is there anything else I could try ? Thanks for every tip, this problem really kills the dev process.
Apparently the following has worked for several people.... Hope it helps you! PS:I'm trying it right now
Open your Project Folder.
Find ProjectName.xcodeproj file.
Right-Click Copy and Paste to Safe Place.
Right-Click Show Package Contents.
Find project.xcworkspace file and delete that file.
Reopen Your Project and clean and Rebuild.
If your problem is not solved than replace the file with your backup file.
In my case, I solved that problem by just closing assistance editor and selecting another source file in Xcode. It was useless to empty /DerivedData folder, cleaning project, rebooting OS or reverting to the previous project. After closing assistance editor and selecting another source file in the project navigator, Xcode successfully completed the indexing. Before then I opened Info.plist with viewController.m source file in Assistance Editor. My Xcode version is 9.4.1.

Remove files from Xcode project

I do not know why, but somehow two files were added to project with a mistake as you can see on screenshot. How can I safely remove them from Xcode project? I've already deleted them from disk, but delete button is grayed out in Xcode interface.
Just had this problem today. The fix for me (on Mac) was:
Find YourProjectName.xcodeproj in finder.
Right click > Show package contents.
Inside there, right click on project.xcworkspace > Show package contents.
Open contents.xcworkspacedata (XML format) in any text editor and manually remove the references.
Hope this helps anyone with the same issue!
Do a clean of all targets and then remove the app from simulator. Finally, relaunch it.
Quit Xcode and relaunch to fix it.
I can't replicate your problem, but you could give this a shot:
Close Xcode. Right-click your .xcodeproj file, show package contents. Make a copy of your project.pbxproj somewhere as a backup, then open the original in TextEdit. Find "MyClass.h" in the file. You should find a few lines containing it; just delete the entire line each time (including the line break). Do the same for "MyClass.m". Then save, and open your project.

Resources