Вопрос

I'm using CFBundleCopyResourceURL to get the path of a shader file in iOS. It returns NULL when run on the device, but works fine on the simulator. What's worse is that this works on another app setup exactly the same way to copy resources. Here are the answers to potential questions that will come my way..

  • The file is in a folder (shaders/shader.vsh), the folder is in my project as a reference (blue color folder in the workspace under the project). The copy bundle resources build phase has an entry for the folder (shaders)
  • The first parameter being passed in (bundle) is a valid main bundle which I get by calling CFBundleGetMainBundle(). I confirmed in the debugger that it is valid
  • I've looked at the package contents for the app image and found the files there. I also looked at the copy commands for those files in the build log and they seem fine.

So clearly, the files are getting copied into the bundle, but for some reason the function fails only on the device in one particular case.

Am I overlooking something else?

Это было полезно?

Решение

The problem turned to be case sensitivity. OSX is case insensitive and iOS is not. Thanks to Ian Henry for mentioning it.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top