TOSMBClient icon indicating copy to clipboard operation
TOSMBClient copied to clipboard

How to use 'attemptConnection'

Open anonymouz4 opened this issue 7 years ago • 0 comments

So I've been stuck with this for a while now and I still can't figure it out how to use.

From what I understood here, it should be able to call it without argument like below but Xcode requires to use a session Pointer session?.attemptConnection() –> xcode doesn't allow this

–> Xcode says, Opaquepointer is required session?.attemptConnection(withSessionPointer: <#T##OpaquePointer!#>)

So I've tried every possible way of using a Opaquepointer Pointer but it always crashes.

Any Ideas or has anybody ever done this successful?

Other Tries: If LoginData is specified -> instant crash If Not -> Prints "Login Failed" and crashes

session = TOSMBSession(hostName: host, ipAddress: "192.168.0.21")
        
        //session?.setLoginCredentialsWithUserName("User", password: "!0z!g")
        
        if let test = session?.attemptConnection(withSessionPointer: OpaquePointer(UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))) {
            print(test.localizedDescription)
        }

anonymouz4 avatar Jun 30 '18 21:06 anonymouz4