Search code examples
objective-cmacoscocoanstableviewnsoutlineview

Why does reloadData work but not reloadItem?


I have a NSOutlineView that works great. If I change the model, the outlineview is updated when I call: [self.myOutlineView reloadData]. However, when I profiled my program it seems that 10% of the time is used on updating my outlineview. I therefore tried to update only the model object that has changed and not the entire outlineview by calling [self.myOutlineview reloadItem:myIndexPath] where myIndexPath is the NSIndexPath to the node in the outlineview I am updating. However, nothing happens when I call reloadItem while everything works perfectly when I call reloadData. Does anyone have any suggestion for what I am doing wrong or how to solve this problem?

Thanks! Cheers, Trond


Solution

  • Outline view's reloadItem: requires the item parameter, not an index path. So, pass the actual item. NSIndexPath is not used by NSOutlineView class at all.