开发者

Objective-C pathForResource doesn't find file, returns null

The code i'm using below doesn't seem to find the file i want, can anyone help?

NSString *path = [[NSBundle mainBundle] pathForResourc开发者_StackOverflowe:@"iTunes Music Library" ofType:@".xml" inDirectory:@"~/Music/iTunes/"];
NSLog(@"%@", path);

Thanks, Sami.


This is looking inside your bundle, so it would be something like /Applications/My App.app/Contents/Resources/~/Music/iTunes (if "~" there is even legal). You're not looking for a bundle resource here. Why are you making this call to find the path of a file you already know the path to?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜