title: Get file path and URL for file in temp directory
body: <p>I'm trying to get the file path of a file called &quot;temp.pdf&quot; which is located in the NSTemporaryDirectory folder (I've checked, the file exists).</p>
  <p>I use this:</p>
  <pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@&quot;temp&quot; ofType:@&quot;pdf&quot; inDirectory:NSTemporaryDirectory()];
  </code></pre>
  <p>I've tried with:</p>
  <pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@&quot;temp.pdf&quot; ofType:@&quot;&quot; inDirectory:NSTemporaryDirectory()];
  </code></pre>
  <p>And:</p>
  <pre><code>NSString *filePath = [[NSBundle mainBundle] pathForResource:@&quot;temp&quot; ofType:@&quot;pdf&quot;];
  </code></pre>
  <p>But it seems that it doesn't work, return value is always null.</p>
  <p>How can I access the file path?</p>