iphone - pathForResource yields erratic null -
i have problems adding shader-glsl files 1 xcode project another. i'm confused @ moment, since can't make path files drag xcode. have checked spelling, "show in finder" many times , still have problem...
here's example of files added xcode, didn't put them sub-directories rule out problems those:
now 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 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, have idea on this?
edit: "tools.png" icon use on tab-bar, in subfolder in resources , test comparison. in case guys wonder why didn't open path other file in screenshot.
edit2: used "clean" crazy in last 2 hours. "fragshader.fsh" appearently doesn't copied "windowconfig.app" bundle though added project in same way added "mo.tut" , 1 in bundle package. how can ensure gets copied?
edit3: target membership checked in inspector both files, still teh shader isn't copied.
solution:
under target-build phases file wasn't in "copy files bundle" list. manually added it, still strange wasn't added automatically after added file project.
have made sure fragshader.fsh in copy files step? (i.e. made sure it's present in resulting app bundle).
Comments
Post a Comment