title: NSTextView not updating in a loop while writing to a USB device
body: <p>I am writing an Objective-C application which communicates with a USB device. The application writes certain data to the device continuously and displays the status of the write operation in a textView, which is an object of NSTextView. I call the <code>-[NSTextView insertText:]</code> method in the loop when I get the write operation status from the device.</p>
  
  <p>The problem is that the NSTextView doesn't get updated at every call of <code>-insertText:</code>. I get the entire contents of the NSTextView only after the entire loop has been executed.</p>
  
  <p>I didn't see an appropriate refresh or update method for NSTextView class. How can I recieve the status of the operation and update the NSTextView simultaneously?</p>
  
  <pre><code>- (IBAction)notifyContentHasChanged:(NSInteger) block {
      NSString *str;
      str = [NSString stringWithFormat:@"Block Written Successfully: %d\n", block];
      [data insertText:str];
  }
  
  - (IBAction)func {
      while(USB_SUCCESS(status))
      {
          printf("\nBlocks Written Successfully: %d",BlockCnt);
          [refToSelf notifyContentHasChanged:BlockCnt];
      }
  }
  </code></pre>
  
  <p>Note that the <code>printf</code> on console is updated timely but not the NSTextView.</p>