0

The app I am building requires a lot of data and images. I was loading these directly into a project group. When I needed to change the files, the old ones were hanging around.

The folks here kindly pointed me to

IOS Simulator>Reset product and settings Product>Clean Product>Clean Build Folder

As the number of files increased, I switched to loading them by creating a Directories rather than groups when loading the data. Since doing this, I have found that the above is not cleaning the old files out. (I can't be certain that this is the root cause but it had always worked until I made this).

The way the app works is it has PNG files paired with description files. The description file tells where the specific PNG file is to be drawn in relation to all the others. The file names indicate their relative position.

I run the app in the simulator, I see images where 1) I can identify the specific file names; 2) that file is not in the project and 3) the file is not in the project folder (finder); and 4) the cleanup steps above have not blown the file away.

In some cases, 1) I see an old version of an image file being displayed by the app; and 2) I can find same image in the project and verify that it is different from what is being displayed.

If I use the steps above to blow away all the data, no images display in the app. If I load the new images, the old images get displayed. (Again, I can see the new images in the project manager and they are different from want the app displays). It appears the simulator is recycling old images from somewhere.

Is there a next level of cleanup to try to blow away the old data files?

user3344003
  • 20,574
  • 3
  • 26
  • 62
  • possible duplicate of [How to Empty Caches and Clean All Targets Xcode 4](http://stackoverflow.com/questions/5714372/how-to-empty-caches-and-clean-all-targets-xcode-4) – matt Mar 24 '14 at 16:40
  • None of the solutions there solve the problem. – user3344003 Mar 24 '14 at 17:46
  • Then I don't think the problem is what you think it is. I didn't understand what you meant by "creating a Directories rather than groups" but I tend to guess that that's the problem. – matt Mar 24 '14 at 17:52
  • When adding the files, I did "Create Folder references for any added folders" instead of "Create groups for any added folders". – user3344003 Mar 24 '14 at 17:54
  • And you understand that that completely changes the way your code will have to refer to the images, right? – matt Mar 24 '14 at 18:34
  • And you also understand that if you didn't also say to Copy the folder, the build process is now looking _outside_ your project for this folder and the images it contains? – matt Mar 24 '14 at 18:40

2 Answers2

1

Here is how you can 'reset any iOS simulator' [XCode > v9]

Erase simulator image

byJeevan
  • 3,728
  • 3
  • 37
  • 60
Obj-Swift
  • 2,802
  • 3
  • 29
  • 50
0

Here's what I ended up doing:

I temporarily added code use NSFileManager to delete the image files.

Then I readded the directory to project.

I have no idea where the files were hiding.

user3344003
  • 20,574
  • 3
  • 26
  • 62