I'm trying to get the file path of a file called "temp.pdf" which is located in the NSTemporaryDirectory folder (I've checked, the file exists).
I use this:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf" inDirectory:NSTemporaryDirectory()];
I've tried with:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp.pdf" ofType:@"" inDirectory:NSTemporaryDirectory()];
And:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"temp" ofType:@"pdf"];
But it seems that it doesn't work, return value is always null.
How can I access the file path?