I am trying to create a new folder, but I cannot figure out how to use createDirectoryAtPath correctly.
According to the documentation, this is the correct syntax:
NSFileManager.createDirectoryAtPath(_:withIntermediateDirectories:attributes:error:)
I tried this:
let destinationFolder: String = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String
let deliverablePath: NSURL = NSURL.fileURLWithPath("\(destinationFolder)/\(arrayOfProjectIDs[index])")!
NSFileManager.createDirectoryAtPath(deliverablePath, withIntermediateDirectories: false, attributes: nil, error: nil)
But it gives me an error
Optional argument 'withIntermediateDirectories' when invoked
I also tried many options, deleting options, etc., but I can't get it to work without errors. Any ideas?
source
share