Ryan D'souza
Ryan D'souza

Reputation: 653

How to dynamically update an NSTreeController and NSOutlineView?

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

to try to force reload the structure.

This is all done programmatically in Objective-C.

Upvotes: 0

Views: 823

Answers (1)

Ryan D'souza
Ryan D'souza

Reputation: 653

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];

Upvotes: 5

Related Questions