I'm developing an app for iOS with Swift 3 that needing an Objective-C library for connect for a few services. This library has methods that require for a callback function, the method works because in the log of the library I can see that the data is receive.
The problem is the next, when I pass nil to the selector I don't have any problem, but when I put a function I get the next error:
2017-03-08 12:30:51.792 ios-example[1095:15243] *** NSForwarding: warning: object 0x608000227d20 of class 'ios-example.ConnectionSettings' does not implement methodSignatureForSelector: -- trouble ahead
Unrecognized selector -[ios-example.ConnectionSettings performSelectorOnMainThread:withObject:waitUntilDone:]
The code is this:
import Foundation
class ConnectionSettings {
var _service : ServiceCall?
@objc func getName(message : StringMessage) {
print("name : \(message.data)")
}
init() {
self._service = Services.makeService(RB_SERVICE_NAME,
responseTarget: self,
selector: #selector(self.getName)))!)
self._service.send();
}
}
I think that the problem will be easy to fix it, but I don't know how to do it. Anyone can help me?
Thanks :)