My file exists though fileExistsAtPath always returns false
<p>I'm using the following code to detect if a file exists. The file does exist but fileExistsAtPath always returns false</p>

<pre><code> if let receiptFound = receiptUrl?.checkResourceIsReachableAndReturnError(error){
        print("receiptUrl is \(receiptUrl?.path)") }

 print("Does the file exist \(NSFileManager.defaultManager().fileExistsAtPath(receiptUrl!.path!))")

    if NSFileManager.defaultManager().fileExistsAtPath(receiptUrl!.path!)


    {  //work with file
    }
</code></pre>

<p>My output is:</p>

<p><a href="https://i.stack.imgur.com/ZMjA8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZMjA8.png" alt="enter image description here"></a></p>

<p>I can't understand why the statement is returned as false when the file exists?</p>