I\'m trying to implement the new view-based OutlineView as a source list in my Mac app. I can\'t get values to display, though, so I made a small test app from the Core Data app
I have created a little sample project which popuplates also popuplates an NSOutlineView
, not with CoreData but the crucial factor is, like @boaz-stuller stated that the correct cell is selected (similar to how you handle UITableViewCell
s in iOS.
So in my case I have implemented the method like so:
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
if ([self isHeader:item]) {
return [outlineView makeViewWithIdentifier:@"HeaderCell" owner:self];
} else {
return [outlineView makeViewWithIdentifier:@"DataCell" owner:self];
}
}
Check out besi/mac-quickies on github. Most of the stuff is either done in IB or can be found in the AppDelegate