2

How does one remove files from a Xcode Project? I'm having troubles by pressing "Delete" and then selecting "Remove References".

I ask because I moved a bunch of PNGs from <root> to <root>/icons/ (after creating the icons subdirectory). I removed the PNGs from the project, and then re-added the PNGs under the new location. I also added an "icons" folder under "Resources" in Xcode. It results in CopyPNG failures due to the old path.

Some testing revealed that Xcode does not remove the references in the PBXPROJ file. Which begs the question, what exactly am I removing from the project if a reference remains? It also begs, how do I truly expunge the data from the project so I can cleanly add it again?

Jeff

1
  • 2
    '-2' - amazing. Folks have written utilities to do this sort of stuff because Xcode is so broken (confer: Slender). Commented Dec 23, 2012 at 8:42

3 Answers 3

4

Here are my thoughts..

1. Right-click the file --> Delete --> RemoveReference

It will remove only the linked reference from your project.The files will not be deleted. They will exist in the project folder. When you require the file again , just browse the files from the project folder and add to your project. Note that "Copy items into the destination group's folder" option should be unchecked.

2. Right-click the file --> Delete --> Move To Trash

It will remove all the files and linked reference from your project. When you require the file again , you have to browse the files from its downloaded/original location and add to your project.Note that "Copy items into the destination group's folder" option should be checked.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks. I'm not sure what's wrong, but I just tried deleting and the damn references and files are still there. I've wasted half a Sunday on this. More Cupertino junk that never should have gotten past their QA department. Its a shame they don't test their software. I can't believe I pay money for this crap.
is the answer satisfied you ?
I'm not sure. Xcode appears broken (yet again), so I don't know if the answer is correct.
the points are yours. I am not going to allow Apple's broken QA process to penalize someone trying to help.
2

You click on your project then right click on mouse select show in finder then remove from it png images or files.Then come on xcode and drag from images in selected folder.It will work......

Comments

0

There is another option, beside Remove References. Click it. This will completely remove the file from your app, including references. I can't seem to come up with a situation in my experiences where I needed to just remoe references.

If you only remove references, the file will disappear from your Xcode project window, but it will still exist in the file system. This causes problems when copying another file in under the same name.

1 Comment

Thanks. I'm not sure what's wrong, but I just tried deleting and the damn references and files are still there. I've wasted half a Sunday on this. More Cupertino junk that never should have gotten past their QA department. Its a shame they don't test their software. I can't believe I pay money for this crap.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.