Re: NSTextView, style, and weird Core Data issue
Re: NSTextView, style, and weird Core Data issue
- Subject: Re: NSTextView, style, and weird Core Data issue
- From: Matt Neuburg <email@hidden>
- Date: Wed, 26 Jul 2006 17:52:37 -0700
- Thread-topic: NSTextView, style, and weird Core Data issue
On Wed, 26 Jul 2006 16:34:19 -0400, "I. Savant" <email@hidden>
said:
> First, (and I'm sure you're aware and it was a slip of the tongue,
>but for archival purposes...) be careful not to equate Core Data to
>Bindings. Both are separate, though they do (and are intended to)
>work together quite nicely.
>
> Second, Bindings does not completely negate the need for your own
>controller layer in most non-academic projects.
I'm not confusing Core Data and bindings; I'm saying that I'm using them
together in such a way that I expect a certain coherent behaviour to happen
automatically. As the selection in the NSArrayController changes, and the
contents of the NSTextView changes, the behaviour of typing at the insertion
point in the NSTextView should always be "correct" without my doing anything
else.
Let's say we're viewing the first entity in the NSArrayController, and the
insertion point in the NSTextView is within some underlined text. Then if I
were now to type, I would expect to type underlined. But now let's say I
switch to the second entity in the NSArrayController. When I type in the
NSTextView, I do not expect to type underlined merely because the insertion
point *used* to be within some underlined text. The NSTextView is supposed
to say, "whoah, things have changed, I need to rethink my typing
attributes."
And that, indeed, is what usually happens. What I'm complaining of is just
that after the creation of a new entity in the NSArrayController, that is
NOT what happens. The new typing *is* underlined. That seems just plain
wrong. The NSTextView's textViewDidChangeTypingAttributes notification is
firing, so I know the NSTextView is thinking about the situation; but it's
getting what I regard as the wrong answer.
The docs say: "Typing attributes are reset automatically whenever the
selection changes." Well, the selection *is* changing. But the typing
attributes are not being reset (at least, I would not describe this
behaviour using the word "reset" - I would describe it as "remaining the
same as before"). So I would say that what I'm seeing is not the expected
behaviour, according to the docs.
Finally, I would suggest that, now that we're focussing on the typing
attributes, I'm not the only person doing some head-scratching over Cocoa's
behaviour in this regard. These threads are all at least obliquely related:
<http://www.cocoabuilder.com/archive/message/cocoa/2006/6/3/164885>
<http://www.cocoabuilder.com/archive/message/cocoa/2005/8/12/144174>
<http://www.cocoabuilder.com/archive/message/cocoa/2006/4/7/160492>
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden