Re: Overriding text size in NSTextStorage
Re: Overriding text size in NSTextStorage
- Subject: Re: Overriding text size in NSTextStorage
- From: Gordon Apple <email@hidden>
- Date: Mon, 10 May 2010 18:40:12 -0500
- Thread-topic: Overriding text size in NSTextStorage
There is a bug in the text system, which I have reported and filed
previously. If you programmatically change the text, the KVO for the
bindings is not triggered and will not update the text storage. If you then
use the keyboard for another edit, it will trigger it and will commit both
changes. This could have some relation to your problem.
On 5/10/10 2:02 PM, "email@hidden"
<email@hidden> wrote:
> On May 10, 2010, at 9:19 AM, Gideon King wrote:
>
>> From a conceptual point of view, my understanding of MVC means that a user
>> initiated action should be reflected in the model (text storage), which
>> should push it through to the view, which should mean that doing the changes
>> in the text storage "should" be OK∑
>
> The NSLayoutManager and associated classes are part of the model too. I think
> what‚s happening is that those objects are seeing the text before it goes into
> your TextStorage, and interpreting the original attributes; while later on
> they pull the text out and see the altered attributes.
>
>> The behavior I'm observing seems to clearly be a case of the view being out
>> of sync with the text storage, until you type something, and then it syncs up
>> again.
>
> It‚s the layout that‚s out of sync, sounds like. The layout is part of the
> model and can be shared by multiple views.
>
> ˜Jens
_______________________________________________
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