Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pathForResource returns null

I'm trying to load some .applescript files in my project.

Copied them into the "Supporting Files" directory like this:

enter image description here

and tried to access them:

NSBundle *bundle = [NSBundle mainBundle]; NSLog(@"Resource path for test.applescript: %@", [bundle pathForResource:@"test" ofType:@"applescript"]); 

pathForResource always returns null.

Both files are correctly imported in xcode. The target membership is my app. Solutions from similar questions didn't really help

What am i doing wrong?

like image 529
patchrail Avatar asked Feb 17 '12 16:02

patchrail


1 Answers

In the Xcode target "Build Phases" add the file under "Copy Bundle Resources"".

like image 158
zaph Avatar answered Sep 19 '22 10:09

zaph