Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode won't let go a resource file

My question today is about how Xcode deals with resource files in the app bundle which it creates. I know that it may be trivial, but I can't find an easy way out. Basically my problem is that Xcode seems to keep on including a resource file (eg a text file) in the app bundle even if the file has been removed from the project. Here it is in detail what is happening here.

⁃   Added a file to the project (both by choosing file - new file or dragging a file to the Xcode groups and files left column checking add to project folder if needed checkbox)
⁃   Compiled and launched the project in simulator
⁃   Verified that the file is present in myApp.app bundle, located in User/Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app and even in <my Xcode projects folder>/myApp/build/debugiPhonesimulator/myApp.app
⁃   Deleted the file from groups and files column in Xcode
⁃   Deleted the actual file with Finder in <my Xcode projects folder>/myApp/myFile
⁃   Deleted User/Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app and even <my Xcode projects folder>/myApp/build/debugiPhonesimulator/myApp.app
⁃   Emptied the trash
⁃   Verified that there is no reference to the file with Finder spotlight
⁃   Verified that there is no reference to the file with Xcode search
⁃   Rebuilt and relaunched the app in simulator
⁃   Verified that a brand new /Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app has been just created
⁃   Verified the content of /Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app bundle: the file is still there. Where the h. did Xcode take it from?

I am surely missing something really obvious. Any help?

like image 647
user236739 Avatar asked Dec 18 '22 01:12

user236739


1 Answers

Have you checked the "Targets" node ? If not then;

  • Expand the "Targets" node and the application one.
  • There must be a build phase called "Copy Bundle Resources".
  • Check that the resource is not in the phase.

You can also try to perform a full clean of the project to ensure that no temporary files stay.

like image 61
Laurent Etiemble Avatar answered Dec 29 '22 10:12

Laurent Etiemble