Home > Mobile >  Xcode: what is a good way to replace a resource file?
Xcode: what is a good way to replace a resource file?

Time:12-09

I have an iPhone application that is compiled under Xcode. I have a file which I shall call 'manual.pdf'. The app has a manual page that shows manual.pdf using WKWebView. The 'manual.pdf' file is generated from OfficeLibre.

When the UI has changed, I go through the original 'manual.odt' replacing the screen shots with new ones, and correcting the text. I then export a new 'manual.pdf'. I then have to...

  • delete the old 'manual.pdf' entry.
  • drag the new file to the Resources directory.
  • fill in the form to get it added.

I don't need a build-time copy script. Those look complicated, and this is not particularly labour intensive, and I don't necessarily want to do it every time the manual changes. But this feels wrong. I would be happy if Xcode just substituted the new file for the old file if it had the same name. But it doesn't.

I am running Xcode 14.1 building for an iPhone 12 running iOS 16.0 FWIW.

CodePudding user response:

I found the answer. I had just edited the file, and I went to Xcode to update the reference. The new version was already there. I guess when I dragged the file, it created a link rather than copying the file.

Nice, once you know it is there.

  • Related