0

When an outlineViewItem is expanded -

 (void) outlineViewItemDidExpand:(NSNotification *)notification

-, I'm able to successfully add an object to the TreeController (log statements show the newly added object in the correct place of the hierarchy), but the OutlineView/UI isn't updating to reflect that insertion.

To no avail, I've used

  • [self.outlineView reloadItem:nil reloadChildren:YES],

  • [self.outlineView reloadData], and even

  • [self.outlineView setHidden:YES] then
    [self.outlineView setHidden:NO]

to try to force reload the structure.

This is all done programmatically in Objective-C.

Armali
  • 18,255
  • 14
  • 57
  • 171
Ryan D'souza
  • 653
  • 11
  • 22
  • Do you use bindings or just `NSOutlineViewDataSource`-protocol methods? – Daniyar Aug 19 '15 at 15:24
  • I use bindings for Value, Outline View Content, and Index Path (NSOutlineView), and Content Array/Controller Content (NSTreeView). The only delegate I use is: - (void) outlineViewItemDidExpand:(NSNotification *)notification – Ryan D'souza Aug 19 '15 at 17:10

1 Answers1

5

6 hours later, I got it.

I needed to update the NSTreeController cache, which is achieved via the rearrangeObjects method.

So the answer to my question is:

[self.cloudDirectoryTreeController rearrangeObjects];
Ryan D'souza
  • 653
  • 11
  • 22