-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
Hi, I'm trying to list down the contents of directory from a ftp server.
iOS: 11.2
XCode: 9.2, Swift 4
Here is the crash error :
*** -[FilesProvider.FileProviderStreamTask respondsToSelector:]: message sent to deallocated instance 0x1c01c4ec0
Below is the code :
let credential = URLCredential(user: hostList![row].username!, password: hostList![row].password!, persistence: .permanent)
let ftpFileProvider = FTPFileProvider(baseURL: URL(string: hostList![row].serverUrl!)!, passive: true, credential: credential, cache: nil)
ftpFileProvider?.contentsOfDirectory(path: "", completionHandler: { (contents, error) in
print(error)
for file in contents {
print("Name: \(file.name)")
print("Size: \(file.size)")
print("Creation Date: \(file.creationDate)")
print("Modification Date: \(file.modifiedDate)")
}
})