我正在try 获取名为"temp.pdf"的文件的文件路径,该文件位于NSTemporaryDirectory文件夹中(我已经判断过,该文件存在).
我用这个:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf" inDirectory:NSTemporaryDirectory()];
我试过:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp.pdf" ofType:@"" inDirectory:NSTemporaryDirectory()];
以及:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf"];
但它似乎不起作用,返回值总是空的.
如何访问文件路径?