 
         let columnIdentifier = tableColumn!.identifier.rawValue
         if columnIdentifier == "bonjour-device" {
-            let device = self.bonjourServer.devices[row]
+            let device = bonjourServer.devices[row]
             result = device.name
         }
         return result


    override func viewDidLoad() {
        super.viewDidLoad()
        self.bonjourServer = BonjourServer()
        self.bonjourServer.delegate = self
    }
    
    // MARK: Bonjour server delegates
    
    func didChangeServices() {
        self.tableView.reloadData()
    }
    
    func connected() {

    func tableViewSelectionDidChange(_ notification: Notification) {
        print("notification: \(String(describing: notification.userInfo))")

        if bonjourServer.devices.count > 0 {
            let service = bonjourServer.devices[tableView.selectedRow]
            bonjourServer.connectTo(service)
        }
    }

    // MARK: - Private

    @IBAction private func sendData(_ sender: NSButton) {
        if let data = toSendTextField.stringValue.data(using: String.Encoding.utf8) {
            bonjourServer.send(data)
        }
    }
}
