Re: NSMutableAttributedString binding
Re: NSMutableAttributedString binding
- Subject: Re: NSMutableAttributedString binding
- From: Douglas Davidson <email@hidden>
- Date: Thu, 10 Jan 2008 11:32:21 -0800
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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden