Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with downloaded files not created in your Example #1

Open
jchesne opened this issue Apr 10, 2015 · 1 comment
Open

Problem with downloaded files not created in your Example #1

jchesne opened this issue Apr 10, 2015 · 1 comment

Comments

@jchesne
Copy link

jchesne commented Apr 10, 2015

After a successfull download, my files are not created in des directory, so i changed this :

let documentsPath: AnyObject = NSSearchPathForDirectoriesInDomains(.DocumentDirectory,.UserDomainMask,true)[0]
let des =  NSURL(string: documentsPath.stringByAppendingString("/file.pdf"))!

By this :

let fileManager = NSFileManager.defaultManager()
let documentsPath: NSURL = fileManager.URLsForDirectory(.DocumentDirectory,inDomains: .UserDomainMask)[0] as NSURL
let des =  documentsPath.URLByAppendingPathComponent("/file.pdf")

And everytings worked perfectly.

@jchesne
Copy link
Author

jchesne commented Apr 10, 2015

Ok my previous post was not correct at 100%. The bug appear when you set des folder in another not yet created folder, example :
let des = NSURL(string: documentsPath.stringByAppendingString("/subfolder/file.pdf"))!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant