0

When calling reloadItem() on my NSOutlineView items do not seem to be updated. ReloadData() updates them fine. As does rowForItem() followed by reloadDataForRowIndexes().

Through debugging I have discovered viewForTableColumn() is never called after a ReloadItem(). This seems strange as why then does this function exist?

So why don't I just use rowForItem() & reloadDataForRowIndexes() you say. Because if the item has isGroupItem returning true, then reloadDataForRowIndexes does nothing. I think I read somewhere that this is because the groupItems do not have columns or something?

Therefore I cannot update the groupItem rows in my NSOutlineView without calling reloadData(). This prevents me using any insert and delete animations... and I want animations.

Has anyone found a way to update groupItem rows using reloadItem??? or any other way which doesn't need to reload entire outline view?

Best,

Gavin

Gavin
  • 203
  • 2
  • 11

1 Answers1

0

Old question but i still came across this today after hours of having similar problems. Anyhow i eventually found this on the developer forums https://forums.developer.apple.com/thread/68477

Essentially an NSOutlineView compares via reference with all of its for item: Any? functions which means structs will not work.

Change my structs to classes did the trick

Joe Maher
  • 5,354
  • 5
  • 28
  • 44