Search code examples
resourcesxcode4

Xcode resources appear in product after removing from project


Using Xcode 4.0 sometimes when I remove resources from the project they still appear in the app when I run it, both in simulator and device. I remove the resource from the Resources group by removing reference only, but afterwards also remove the actual file in Finder, and yet the resource magically appears in the app.

Doing a project clean did not help.


Solution

  • A bundle (and hence also an app) is just a directory, as seen from Unix and Unix-derived tools' point of view.

    My guess is that they are still in the bundle because Xcode left a copy there once, and removing the originals in the source directory does not remove the copies in the built app bundle.

    If you delete the app from the build directory (or the build directory altogether), you shouldn't see them any more inside a freshly built app.