After changing NSOutlineView cell-based to view-based, it's not display the icons and titles of file-system tree. Here my code:
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item {
if ([[tableColumn identifier] isEqualToString:@"name"])
return [(ImageAndTextCell *)cell setTextFieldImage:[item icon]];
}
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
return [((ConstructorFSEntity *)item) title];
}
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
if ([item isKindOfClass:[FSEntity class]]) {
return [outlineView makeViewWithIdentifier:@"HeaderCell" owner:self];
} else {
return [outlineView makeViewWithIdentifier:@"DataCell" owner:self];
}
}
And I've one more question. How to put the enumerated items (array of file system's item) to the cell "DataCell", and "HeaderCell" declare as parent folder (group) and assign it a title (for example, @ "Root Folder") and the path of the class. Because, now previous view-based method, displayed enumerated item only in "HeaderCell" or "DataCell" and when I trying assign to "HeaderCell" a some value, the app crashing. Can you help me with this?