Reputation: 6773
I bundle some JSON configuration files with my app.
They are included via Xcode using Folder references (shown as blue folder icons).
Sure enough, the files in those folders can be found within the app under the bundle. Modifying the files (i.e. changing the JSON contents) also works.
However, I've added / removed some of the files in those folders, but I'm still seeing the old files, and not the new ones on my test device.
I've tried deleting the app, and rebooting the device, but still when I run the app again on the device, I still only see the old bundled files.
The Simulator was persuaded to see the new file set via a Simulator reset - not a good option for a real device. It's painful enough in development, but not an option for a released app.
I'd appreciate knowing why this is happening, and how to overcome this such that the latest folder contents are synched with the device.
Upvotes: 1
Views: 189
Reputation: 89569
The only way to reliably remove out outdated files from apps built with "folder references" is to do a clean build (where not only the app is deleted and completely re-built, but also the "Derived Data" folder is completely cleaned out).
AFAIK, there are no rules built into Xcode to remove deleted files from targets built with folder references. I frequently see this when a project I work with puts all of it's images (or some resources) into a single folder and then subsequent builds keep the old files (with their old filenames) still around, even though they aren't in the original source code folders.
This seems like an opportunity for someone to write an Xcode plugin or some tool to validate the contents of a built app/target to make sure the files in there are a 1-to-1 match.
Upvotes: 1