I am learner on iOS Development,today i try to code somethingenter image description here about FileManger,but this method return a type '()',how can i to resolve it?
the warning code as follow:
I am learner on iOS Development,today i try to code somethingenter image description here about FileManger,but this method return a type '()',how can i to resolve it?
the warning code as follow:
The problem is that your call to createDirectoryAtURL
does not have a explicit return value. In Swift, that means it returns a Void
which is represented by the empty tuple ()
. This is what your call should look like.
let temp = NSTemporaryDirectory()
let newDiretoryURL = NSURL.fileURLWithPath(temp + "/MyNewDirectory")
try fileManager.createDirectoryAtURL(newDiretoryURL, withIntermediateDirectories: false, attributes: nil)
print("Success")
}
} catch {
// handle errors here
}