title: Validate decimal max/min values in a NSTextField
body: <p>First of all i have to do this without IB and without advanced Objective-C techniques like KVO. </p>
  
  <p>My problem comes from the simple fact that i can't find a way to get the whole new string value of the text field.</p>
  
  <p>I'm tried using the delegate function:</p>
  
  <pre><code>- (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString
  </code></pre>
  
  <p>but this does not give me only the replacement string not the full string i need for validation. I can later use text</p>
  
  <p>I found </p>
  
  <pre><code>- (void)textDidChange:(NSNotification *)aNotification 
  - (void)controlTextDidChange:(NSNotification *)aNotification
  </code></pre>
  
  <p>but when i get this calls it is already to late and the last text field content is already gone. So what is the best way to handle this?</p>
  
  <p>And yes i did read <a href="https://stackoverflow.com/questions/527322/binding-nstextfield-to-nsnumber">binding NSTextField to NSNumber</a> but it gives me no clue how to solve my problem.</p>
  
  <p>All i need is a  simple "- (BOOL)acceptNewValue(NSString string)" testing function. Why is everything so complicated with Cocoa it starts to feel like MFC.</p>