Skip to content

Crash AFTER trying to retrieve contents of directory from FTP #79

@gouen95

Description

@gouen95

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)")
            }
        }) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions