user6631314
user6631314

Reputation: 1980

Xcode: Remove reference to files not showing up as option

I meant to add one file to my project and I accidentally added the entire directory.

Yikes!

I realized it immediately and tried to hit cancel to no avail. The entire directory which contains lots of other Xcode projects got added to my xcode project.

I now want to remove all those files. Normally, you delete and it gives the option to remove reference or move to trash. In this case I don't want to move to trash as I don't want to delete the underlying files, only their presence in this project. However, it is not giving me the option to remove references. It is only giving the option to move to trash or cancel.

Can anyone suggest why I am not getting option to remove reference? Or alternatively, can you suggest how to remove all these files without moving them to trash.

Thanks in advance for any suggestions.

Upvotes: 2

Views: 2400

Answers (1)

Joe
Joe

Reputation: 4074

  1. The project sub folder you might not be getting the remove reference option since there is no location for it in file inspector, try doing the delete operation on that root folder(of extra files added).

Still if you wont get option here are couple of options:

  1. You can discard your local changes, if your repo is GIT and you are using SourceTree just reset your files or discard also you can do that from XCode > Source Control > Discard All changes
  2. Select that folder in project and in the file inspector track the file path and take backup and then perform delete action with Move to trash option

Or if you don't have further option and not other way to fix, check out the code in new directory and trash the current one.

Upvotes: 1

Related Questions