When I test my app on the simulator, everything works fine. But when I test on my iOS Device, I get this error:
*** Terminating app due to uncaught exception 'FileNotFound', reason: 'file '/Users/name/Documents/appname/GFX/MainMenu.png' not found'
I checked the Build Phases Copy Bundle Resources and everything is added. When I highlight the file in Xcode, Target Membership is checked in utilities.
I also tried omitting the code that loads the file, but I get the same error on a different file. It seems that only the app icons and launch images load properly.
Please note that I am using Sparrow Framework (if that makes any difference). The textures are loaded like so:
SPTexture *gameMenuTexture = [SPTexture textureWithContentsOfFile:(@"/Users/name/Documents/appname/GFX/MainMenu.png")];
SPImage *gameMenuImage = [SPImage imageWithTexture:(gameMenuTexture)];
[self addChild:gameMenuImage];
Help will be much appreciated. I’ve looked all over forums for answers. Thanks!
Test something like this
SPTexture *gameMenuTexture = [SPTexture textureWithContentsOfFile:(@"MainMenu.png")];