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

medasmx

macrumors member
Original poster
Nov 9, 2008
89
0
In an apple developer example(DragNDropOutlineView), the following line of code is present --
"SimpleTreeNode*=(item==nil)?treeData:item;"

I haven't been able to find documentation regarding this online. However, in the Kochan book, a?b:c is called a conditional(if...then, I suppose). It would read if a is true then b otherwise c. From the above statement to me that means, if item==nil then treeData otherwise item. The full block of code is ...

Code:
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
    SimpleTreeNode *node = (item == nil) ? treeData : item;
    return [node numberOfChildren];

Thanks for any explanation. Adam
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.