I'm trying to detect if helper tool is installed trough error handler, but the error block won't get executed neither the success block. When the helper is already installed it works fine. It just doesn't catch errors when there is one. In documentation is that always one of those two blocks get executed
if helperToolConnection == nil {
let connection = NSXPCConnection(machServiceName: "**bundle identifier**", options: NSXPCConnectionOptions.Privileged)
connection.remoteObjectInterface = NSXPCInterface(withProtocol: HelperProtocol.self)
connection.invalidationHandler = {
self.helperToolConnection = nil
}
connection.resume()
helperToolConnection = connection
}
let helper = helperToolConnection!.remoteObjectProxyWithErrorHandler() { error in
NSLog("Failed to connect: \(error)")
withReply(nil)
} as! HelperProtocol
helper.connectWithEndpointReply() { endpoint -> Void in
withReply(endpoint)
}