3

I deleted default.png from my resources folder because I wanted a different image for the loading screen, but I just deleted the reference which was apparently a dumb thing to do. I dragged the new image into resources and tried to change the name to Default.png, but it won't let me, which I think is because the first Default.png is still in the repository somewhere. Anyway, how do I delete that image(and others with which I have probably done the same thing) from the repository when it is no longer visible in xcode?

Ryan
  • 570
  • 9
  • 25

4 Answers4

6

What kind of repository is it? Subversion? Git?

The SCM integration in Xcode is great for checking out files and committing changes without having to leave the IDE, but it's hardly a full-blown GUI front end to either svn or git. It may be possible to fix your mistake by adding the file back to the project and then deleting it in Xcode in such a way that Xcode will remove it from the repository for you, but the simple solution is to just delete the file from the repository yourself by using the appropriate version control command. For example, if you're using Subversion you could:

svn remove default.png

to remove the file from your version of the repository. When you commit your changes, the file will be deleted in that version. (It'll still exist in previous versions -- that's the whole point of SCM, after all.)

After that, you can create the new file and add it to both the project and the repository in the usual way.

Caleb
  • 124,013
  • 19
  • 183
  • 272
  • You're right, it is subversion, but when I try this in terminal I get: '.' is not a working copy. Do I need to put the URL of the repository somewhere? – Ryan Jun 03 '11 at 14:39
2

You need to manually go into your app's file structure and delete the image files themselves. Also, it is usually a good idea to "clean" the app whenever you remove files or references to files from an XCode project, since XCode can be a bit temperamental about removing files; the key combination for this is

Hope this fixes your problem.

mdominick
  • 1,319
  • 1
  • 10
  • 21
2

Clean all targets should work (at least it worked for me). You can try the following:
a) delete the reference from "Copy Bundle resources" of your target
b) delete the app from Simulator/Device
c) clean all targets

Tatvamasi
  • 2,537
  • 19
  • 14
0

Caleb is absolutely right. That fixed the problem here as well for the most files.

An easier way to get an overview of the accidentally un-deleted files, is creating a bookmark of the working copy with Versions (SVN Software - in case you use SVN). There you can detect the problematic files grafically and delete them. I always have to do this after restructuring the project folder.

brainray
  • 12,512
  • 11
  • 67
  • 116