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 ...
Thanks for any explanation. Adam
"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