title: macOS Swift TextField.stringValue not returning updated value until I click on something else
body: <p>I apologize if this has been asked before but I couldn't find what I was looking for online over the last few hours. I'm still functional a noob with swift.</p>
  
  <p>I am trying to store the stringValue of a TextField when I click a NSButton. If I click anywhere and then click on the NSButton the code works perfect but if I don't click the stringValue is still reporting the previous value.</p>
  
  <pre><code>@IBOutlet weak var NameText: NSTextField!
  @IBOutlet weak var SaveChangesAccountButton: NSButton!
  
  var selectedAccountItemNumber = NSInteger()
  
  @IBAction func SaveAccountChanges(_ sender: Any)
  {
      let AccountName = NameText.stringValue
  
      AccountingData.instance.book.account[selectedAccountItemNumber].name = AccountName
  }
  </code></pre>