title: delete and add row in view Based NSTableView
body: <p>I did IOS development but new to OSX. I am facing problem that I delete the row in NStableView successfully by clicking the button in row of table but when I click on add button the deleted row appears again and then its not deleted.
  Here is my delete function</p>
  
  <pre><code>   func delIssue(_ sender:NSButton)
  {
    let btn = sender
    if btn.tag &gt;= 0
    {
      let issueValue = issueKeys[btn.tag]
      for index in 0..&lt;issueName.count
      {
        if issueValue == issueName[index]
        {
          issueName.remove(at: index)
  
          rowCount = rowCount - 1
          self.tableView.removeRows(at: NSIndexSet.init(index: index) as IndexSet , withAnimation: .effectFade)
          self.tableView.reloadData()
          break
        }
      }
    }
  }
  </code></pre>
  
  <p>rowCount is basically variable which I increment when row is added and decrement when row is deleted respectively.
  My adding Row function is</p>
  
  <pre><code>    @IBAction func addRow(_ sender: Any)
    {
      rowCount += 1
      DispatchQueue.main.async
      {
        self.tableView.reloadData()
      }
    }
  </code></pre>
  
  <p>And data source is</p>
  
  <pre><code>  func numberOfRows(in tableView: NSTableView) -&gt; Int
  {
    return rowCount
  }
  </code></pre>