Re: NSTextStorage subclass question
Re: NSTextStorage subclass question
- Subject: Re: NSTextStorage subclass question
- From: Gideon King <email@hidden>
- Date: Sun, 7 Feb 2010 18:00:57 +1000
Thanks for mentioning that - I did actually pick that one up along the way and changed it, but it appears that I still needed to delay the selection change on the text view as well.
On 07/02/2010, at 12:42 PM, Kyle Sluder wrote:
> On Sat, Feb 6, 2010 at 6:17 PM, Gideon King <email@hidden> wrote:
>> I found the root cause of my problem - I was trying to call setSelectedRange and setTypingAttributes on my text view in the textStorage processEditing method, and the system didn't like that. I have altered it to use perform...afterDelay: and it works fine now.
>
> This is not the correct way to fix this problem.
>
> You should not have overridden -processEditing. You should instead
> have implemented -textStorageWillProcessEditing: in your text
> storage's delegate, which the documentation describes as the
> appropriate place to "make changes to the text storage object’s
> characters or attributes to enforce whatever constraints it
> establishes."
>
> --Kyle Sluder
_______________________________________________
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