Skip navigation.
 
mlRe: NSMutableAttributedString binding
FROM : Douglas Davidson
DATE : Thu Jan 10 20:32:21 2008

On Jan 10, 2008, at 11:28 AM, Ivan C Myrvold wrote:

> OK, I did follow your advice, and tried
>
> NSMutableAttributedString *astr = [oattributedTextView textStorage];
> [astr replaceCharactersInRange:elementRange withString:[te c]];
>
> where oattributedTextView is the outlet of the NSTextView.
>
> Now, I got the change immediately shown in my NSTextView.


Be sure to read the text system documentation on working with the text 
storage.  There are a number of useful things to note--for example, 
multiple changes can be grouped for efficiency by surrounding them 
with beginEditing/endEditing calls.  If your text view is editable and 
you wish your changes to participate in undo etc. alongside other user 
changes, you need to notify the text view with should-change/did-
change calls.

Douglas Davidson

Related mailsAuthorDate
mlNSMutableAttributedString binding Ivan C Myrvold Jan 10, 18:11
mlRe: NSMutableAttributedString binding Douglas Davidson Jan 10, 18:28
mlRe: NSMutableAttributedString binding Jonathan Dann Jan 10, 19:23
mlRe: NSMutableAttributedString binding Ivan C Myrvold Jan 10, 20:28
mlRe: NSMutableAttributedString binding Douglas Davidson Jan 10, 20:32