1

I have spent las 4 hours trying to figure out why Xcode 4 is not correctly synching my asset folder with simulator. The problem is the following:

1) I have a bunch of images, etc... in a folder called Assets. This folder has being added to Xcode with the creating folders option (It creates folders (blue) not groups (yellow)).

2) I add an image to Assets/image folder on disk and instantly it is updated in Xcode.

3) I compile and run the application and I can see how the application installed in the simulator gets the new file added.

4) I remove that file from the Assets/image folder. Xcode shows the change instantly.

5) I build and run the application but the file is not removed from the Assets/Image folder in the simulator.

Of course, I have the Assets directory added to a Copy Build phase. So, the only thing that comes to mind is that it just copies the files from the source folder (Xcode build folder) to the simulator app folder, but do not updates it, if something is there that is not used it will not be removed. What is IMO something really ugly and weird.

Same thing happens with files in Resource Group in Xcode. Am I missing something? I have not much experience with Xcode.

Thanks in advance.

Notbad
  • 5,936
  • 12
  • 54
  • 100

1 Answers1

1

Be sure to clean your app (Shift-Command-K) or clean the build folder (Option-Shift-Command-K) after making the directory structure change and before running again. Here is a handy list of Xcode keyboard shortcuts.

coneybeare
  • 33,113
  • 21
  • 131
  • 183
  • This is not a solution to the problem, I used both commands before posting and it did not work. My build directory is Ok with the correct files (the ones shown in Xcode). The problem seems to be when this build has to be copied to the simulator folder, just right after executing application. – Notbad Jul 30 '11 at 14:28
  • The only way I have found to have my asset folder properly synched is to delete it manually right after build. Then when app is ran, a verbatim copy of the folder is done to the simulator app directory. This is not a good solution, just wanted everyone to know the root of the problem. Any suggestion?. – Notbad Jul 30 '11 at 14:38
  • Well, I ended creating a new build phase and adding a rm command to my asset directory. This is the best I have came with after 4 hours of testing Xcode behaviour. If anyone has a better solution let me know. Thanks. – Notbad Jul 30 '11 at 15:02