Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
From what i need to start? May i do it with TableView or better from scratch? May be somewhere exist something like this?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
If you want the collapsible style then you'll need an NSOutlineView. It looks like you might be able to use outlineView:dataCellForTableColumn:item: to get the full row appearance that Xcode uses for each setting group (e.g. Architectures, Build Locations, etc.) with a custom NSCell.

Everything else looks fairly standard though.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
So this is actually really easy to do. I didn't know that the gray group header style is already built-in (new in 10.5). You just need to implement outlineView:isGroupItem:. But in order to get it to look *exactly* like Xcode you need to implement outlineView:dataCellForTableColumn:item: as well and return an NSTextFieldCell. No custom classes required.
 

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
Great thanks, now im trying to do my task with OutlineView, for that purpose i explore DragNDropOutlineView example. And now i confused with one problem. I populate OutlineView through [SRC]
- (NSArray *)childrenForItem:(id)item {
if (item == nil) {
return [rootTreeNode childNodes];
} else {
return [item childNodes];
}
}

- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
// 'item' may potentially be nil for the root item.
NSArray *children = [self childrenForItem:item];
// This will return an NSTreeNode with our model object as the representedObject
return [children objectAtIndex:index];
}
[/SRC]
Top level showed pretty well, but with next i have EXC_BAD_ACCESS, and its really bad, its retuen NSTreeNode object with my DSimpleNodeData in representedObject, but no data there((

But it was inserted, im sure
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.