Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

XCode 4 Deleting files from a project

Hello,

This is an annoying feature added to XCode-4.

Today I was working on a project and needed to add some existing files. But I accidentally added the entire folder. On deleting the folder from XCode-4 it got deleted from the machine. completely. The files are not even found in Trash. This is stupid and Apple needs to fix this. I remember deleting a file/folder from XCode 3.3 would still keep the file in at least Trash.

Any help is appreciated. Any free softwares to recover the files ? Thank you.

Desperate.

iMac, Mac OS X (10.6.6)

Posted on Mar 21, 2011 12:41 PM

Reply
18 replies

Mar 22, 2011 10:06 AM in response to etresoft

Yes it does. But in XCode 3 when you choose 'Delete' instead of 'Remove references' it would delete the file/folder only from the Project Folder and not the machine entirely. And sometimes it is useful eg.: when you want to replace the said file with another file with the same name, more particularly lets say if you want to change the Default.png file you would delete it rather than just removing its references.

I seriously feel there should be at least a warning or something that says this your last chance to say goodbye to this file. Sayonara !!

Mar 22, 2011 12:30 PM in response to unspokenblabber

W/Xcode 4, I see a dialog that says cancel; remove; remove reference only; delete. Right above that is says "The operation cannot be undone. Unsaved changes will be lost".

The 'are you sure' effort is therefore in place.

If you want 'are you sure you're sure?' style of dumbed down Window's dialogs, you're not going to get it w/these tools...that hasn't changed. Don't blame the tools.

Mar 23, 2011 6:52 AM in response to K T

Oh well.. lets see you loose your files and then not blame this change. There are three buttons that say 'Cancel', 'Remove Reference Only' and 'Delete'. How long have you been using XCode and if you have been using it longer than a year then you must've been used to deleting if you wanted to delete as opposed to just removing reference. Read my earlier comments. This was a subtle change with major consequences.

Mar 23, 2011 9:43 PM in response to unspokenblabber

You poor soul. You did exactly what I did an hour ago. The files were nowhere to be found on my filesystem as I verified with the mdfind command. I did find my files in time machine and by luck they were within a few compilation errors of completion.

Goodness yes this needs to get fixed! A lot of the code I write is straight forward but these changes were a result of a significant refactoring I had nearly completed.

Apr 3, 2011 11:02 AM in response to unspokenblabber

This really needs to be fixed. I got bit by this today as well..

I created a default Audio Unit, then added a second target to my project with another Audio Unit. When I decided to delete the second target I said yes to deleting the files, read the warning about not being able to undo this and clicked okay because I really didn't want any of the files anymore. Then Xcode deletes all the included AudioUnit system files from my computer (AUBase.h, etc...) because they were linked in a folder within the project!! Now I have to re-download and reinstall XCode4 to get the files back. Sheesh.

Apr 4, 2011 10:26 AM in response to D7

D7 wrote:
You poor soul. You did exactly what I did an hour ago. The files were nowhere to be found on my filesystem as I verified with the mdfind command. I did find my files in time machine and by luck they were within a few compilation errors of completion.


Time Machine was not designed for source control. Xcode supports both git and subversion.

Goodness yes this needs to get fixed! A lot of the code I write is straight forward but these changes were a result of a significant refactoring I had nearly completed.


Doesn't refactoring save a snapshot of your project by default?

Apr 4, 2011 7:56 PM in response to etresoft

Of course time machine is not designed for source control. It does, however, provide a near hourly backup that helped solve my immediate problem. I am using git and perhaps if my experience with git wasn't so low I would have been able to recover the files. During and after the loss I've spent a good deal of time learning git at the command line.

Refactoring may save a snapshot but I believe it does so when you start--I was well into the changes by then.

XCode 4 Deleting files from a project

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.