Re: NSTextView scrolls to top on Save
Re: NSTextView scrolls to top on Save
- Subject: Re: NSTextView scrolls to top on Save
- From: Kyle Sluder <email@hidden>
- Date: Sun, 19 Dec 2010 17:04:55 -0800
On Sun, Dec 19, 2010 at 1:20 PM, Andy Lee <email@hidden> wrote:
> I can understand why Apple wouldn't use a bindings-based solution for this example, since bindings is an advanced topic unto itself, but I think using an NSTextStorage would be appropriate given the context. Unless someone spots a fatal flaw, I'll submit it as a doc suggestion.
The reason they didn't use bindings here is because it's not
appropriate for hooking up an NSTextStorage to an NSTextView.
Bindings (really, KVO) can't deal with mutable value types. In the
world of KVO, all changes mean that the actual object identity has
changed, not merely the value it contains.
NSTextViews can be used as editors for simple immutable NSString
properties, which is when using them with bindings is appropriate.
--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