Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
- Subject: Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
- From: Ed Baskerville <email@hidden>
- Date: Sun, 2 Oct 2005 10:44:49 -0700
In an NSOutlineView's data source delegate, I implement
-outlineView:setObjectValue:forTableColumn:byItem:
to capture the user's edits. However, besides being invoked when the
user
has ended editing, this method also gets invoked when a cell is merely
selected (clicked), and also when editing begins (double-clicked).
Because my implementation also registers an undo operation, it thus
registers two or three undo operations for each edit, one or two of
which
don't do anything since the text has not changed. I have worked
around the
problem by adding
if ([newText isEqualToString:existingTextInDataSource])
return ;
before doing anything, but this seems like a kludge.
I notice that the notification -controlTextDidEndEditing is only invoked
once, as desired, so maybe I could use that instead. But it looks
like that
would be even more of a kludge since I'd then have to go fishing to
get the
new text, identify the column and affected item.
What's wrong with this picture?
Jerry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40edbaskerville.com
This email sent to email@hidden
_______________________________________________
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