I managed to solve my issue by adding the following code (No change in viewForTableColumn):
- (void)outlineViewSelectionDidChange:(NSNotification *)notification {
NSNotificationCenter * center = [NSNotificationCenter defaultCenter];
[center removeObserver:self
name:@"NSOutlineViewSelectionDidChangeNotification"
object:self.sidebarOutlineView];
NSInteger s = [self.sidebarOutlineView selectedRow];
NSInteger lastSelectedRow = [[self.globalVariableDictionary objectForKey:@"lastSelectedRow"] integerValue];
[self.globalVariableDictionary setObject:[NSNumber numberWithInteger:s] forKey:@"lastSelectedRow"];
[self.sidebarOutlineView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:s]
columnIndexes:[NSIndexSet indexSetWithIndex:0]];
[self.sidebarOutlineView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:lastSelectedRow]
columnIndexes:[NSIndexSet indexSetWithIndex:0]];
[self.sidebarOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:s] byExtendingSelection:NO];
[center addObserver:self
selector:@selector(outlineViewSelectionDidChange:)
name:@"NSOutlineViewSelectionDidChangeNotification"
object:self.sidebarOutlineView];
[center addObserver:self
selector:@selector(outlineViewSelectionDidChange:)
name:@"NSOutlineViewSelectionDidChangeNotification"
object:self.sidebarOutlineView];
}
By doing this, we force the call of viewForTableColumn: when a user change the selection.
Thanks !