• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
  • Next by Date: Control position
  • Previous by thread: Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
  • Next by thread: Unnecessary Invocations of outlineView:setObjectValue:forTableColumn:byItem:
  • Index(es):
    • Date
    • Thread