Re: selectionShouldChangeInTableView called twice
Re: selectionShouldChangeInTableView called twice
- Subject: Re: selectionShouldChangeInTableView called twice
- From: Graham Cox <email@hidden>
- Date: Sun, 21 Dec 2008 14:00:15 +1100
On 21 Dec 2008, at 12:26 pm, Jerry Krinock wrote:
On 2008 Dec, 20, at 10:23, Andre Masse wrote:
I'm using a master/detail view in my application. If the user
select another row in the master table and the detail has been
modified, I want to present an alert to save, cancel or return to
detail.
Back to the original question, I always thought that the desired
behavior in this case would be to simply set the change in the data
model without asking. You mentioned "save". Indeed, I would not
"save" in the sense of saveDocument:. But like Graham said, a table
entry is "cheap" [in user effort] to restore the old value if it was
a mistake. And the proper, easy way for the user to restore it
would be -- drum roll -- Undo -- cowbell :)
I agree with this.
If the UI is part of an inspector-type interface, i.e. modeless, then
just make the change but do it undoably. Performing the Undo naturally
updates any visible UI that matters (KVO/Bindings makes this trivial).
The main case where a Save/Cancel approach makes much sense is in a
modal situation, in which case the OK/Cancel buttons already imply the
answer - Save on OK, revert on Cancel. Or, if you prefer for a
modeless dialog, present an alert on window close, though I dislike
this myself - a modeless window might as well use Undo, unless it's
editing a very specific aspect of the data model, such as user
defaults, where it's not usually appropriate to use Undo. Bear in mind
you can create an undo manager at any time.
--Graham
_______________________________________________
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