Come è possibile?NSFileManager.defaultManager(). FileExistsAtPath restituisce false anziché true
let exists = NSFileManager.defaultManager().fileExistsAtPath(path.absoluteString)
print("exists: \(exists)") //false
Questo è path.absoluteString
//file:///Users/kuna/Library/Developer/CoreSimulator/Devices/92BD140D-5C14-43C4-80D6-904BB9594ED6/data/Containers/Data/Application/5B818832-BB19-4047-A7F8-1487F36868D6/Documents/wishlists/68/147/128/IMG_0006.PNG
e si può vedere che è lì dove dovrebbe essere:
Che cosa sta succedendo?
è possibile stampare il documento PrintDocument directory func() { lasciare pathtofile = NSSearchPathForDirectoriesInDomains (NSSearchPathDirectory.CachesDirectory, .UserDomainMask, true) [0] fare { lasciare namesOfFile = provare Manager.contentsOfDirectoryAtPath (pathtofile) per il nome in namesOfFile { di stampa ("nome: \ (nome)") } } catch lasciare errore come NSError { di stampa ("print: \ (errore)") } } – kholl
così apparentemente il file non esiste. Come lo salvate – kholl