title: Debugging an exception in a Cocoa app
body: <p>I am working on an app with an NSTextView.  When I paste random bytes into it (say, from a compiled C program) it displays gibberish, as it should.  However, when I -setShowsControlCharacters:YES, the same causes a crash and gives the following error multiple times:</p>
  
  <p><code>2008-11-22 00:27:22.671 MyAppName[6119:10b] *** -[NSBigMutableString _getBlockStart:end:contentsEnd:forRange:stopAtLineSeparators:]: Range or index out of bounds</code></p>
  
  <p>I created a new project with just an NSTextView with the same property and it does not have this problem.</p>
  
  <p>My question is, how can I debug my app to find the cause of the error?  I have no idea where the bug originates.  I am not familiar with the debugger built in to Xcode.  If anyone could point me in the right direction in terms of how to track down such a bug I would be very grateful.  Thanks.</p>