I have some problems adding my shader-glsl files from one xcode project to another. I’m completely confused at this moment, since I can’t make a path to files I simply drag into xcode.
I have checked spelling, “show in finder” many times and still have the problem…
Here’s my example of files I added to xCode, I didn’t even put them into sub-directories to rule out any problems with those:

Now my code:
NSLog(@"Filepath of Tools-image: %@",[[NSBundle mainBundle] pathForResource:@"tools" ofType:@"png"]);
NSLog(@"Filepath of mo-tut is: %@",[[NSBundle mainBundle] pathForResource:@"mo" ofType:@"tut"]);
NSLog(@"Filepath of FragShader-fsh is: %@",[[NSBundle mainBundle] pathForResource:@"fragshader" ofType:@"fsh"]);
At run-time I get this output:
2011-07-02 02:03:33.516 windowconfig[16192:707] Filepath of Tools-image: /var/mobile/Applications/BC82AD2C-B8B9-4751-80A2-31EC5ACEC9C2/windowconfig.app/tools.png
2011-07-02 02:03:33.526 windowconfig[16192:707] Filepath of mo-tut is: /var/mobile/Applications/BC82AD2C-B8B9-4751-80A2-31EC5ACEC9C2/windowconfig.app/mo.tut
2011-07-02 02:03:33.531 windowconfig[16192:707] Filepath of FragShader-fsh is: (null)
Please, does anyone have an idea on this?
EDIT: “tools.png” currently is an icon I use on a tab-bar, its in a subfolder in resources and was just a test for comparison. In case you guys wonder why I didn’t open the path to the other file in the screenshot.
EDIT2: I used “Clean” like crazy in the last two hours. “fragshader.fsh” appearently doesn’t get copied to the “windowconfig.app” bundle even though I added it to the project in the same way I added “mo.tut” and this one is in the bundle package. How can I ensure it gets copied?
EDIT3: Target Membership is checked in the Inspector for both files, still teh shader isn’t copied.
Solution:
Under Target-Build Phases the file wasn’t in the “copy files to bundle” list.
I manually added it, but still its strange it wasn’t added automatically after I added the file to the project.
Have you made sure that fragshader.fsh is in a copy files step? (i.e. made sure it’s actually present in the resulting app bundle).