Accessing the string and attribute data in a NSTextView

NSTextView stores its data in a NSTextStorage object. NSTextStorage descends from NSMutableAttributed string, so that gives us a clue. The easiest thing to do is to make a category on the NSAttributedString class to do whatever it is you want containing something like the following.      NSRange range;      int i;      int L = [self length];                  i = 0;      while(i<L) …