Why use a NSController (was Re: Cocoa bindings one- or bi-directional)
Why use a NSController (was Re: Cocoa bindings one- or bi-directional)
- Subject: Why use a NSController (was Re: Cocoa bindings one- or bi-directional)
- From: Tim Lucas <email@hidden>
- Date: Tue, 31 May 2005 16:37:10 +1000
On 28/05/2005, at 2:10 AM, Jonathon Mah wrote:
Say you have an app that does some calculations based on some values
in text fields. These calculations take a few seconds. When a user
goes into a field, changes the value, and commits editing (by hitting
return, tabbing out, or clicking somewhere else) the rest of the
document recalculates.
The user is in one of the text fields and has typed a value, but
hasn't committed editing in any way. She hits Cmd-S. What should
happen here is that the value be committed, the document recalculated,
and finally saved, with the focus remaining in the text field.
NSController and friends takes care of this committing.
Now again, the user is in another text field and has typed a value,
but hasn't committed. She then decides to revert the document or quit
the app. Here the editing should be discarded immediately with no
recalculation (as it takes time, and the results would just be thrown
out anyway). Again, NSController takes care of this situation.
Thanks Jon, much appreciated. I figured it was as much, but didn't know
the details.
Hats off to the Cocoa and NeXT devs for allowing me to write fairly
complex cocoa apps for the past year without delving into the details
of NSEditor and friends. It's always a case of learn it as you need
it...
- tim lucas
_______________________________________________
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