pathForResource returns null

前端 未结 5 1346
清酒与你
清酒与你 2021-02-02 06:50

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

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

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 07:31

    Does your image assume that that file in some folder?

    Try pathForResource:ofType:inDirectory: method in this case:

    NSLog(@"Resource path for test.applescript: %@", [bundle pathForResource:@"test" ofType:@"applescript" inDirectory:@"folder/Supporting Files");
    

提交回复
热议问题