1

I have an NSOutlineView bound to an NSTreeController. In the outlineView's delegate, I found that the method outlineViewSelectionDidChange(_ notification: Notification) got called twice when (1) there was a row selected and (2) clicked the title row to collase the group.

The selected rows are both -1. The doc of this method doesn't mention this behaviour.

Is there a way to save one of the two calls?

LShi
  • 1,500
  • 16
  • 29

1 Answers1

0

Did you register for the notification in your delegate?

I observed the same thing you report (outlineViewSelectionDidChange was being called twice) and it was due to adding an observer for NSOutlineViewSelectionDidChangeNotification in my delegate's viewDidLoad. I removed the registration and outlineViewSelectionDidChange was called only once.

P. Banta
  • 1
  • 1