this is just a little info.
If you want that the expand/collapse button of the provided example app shows the according icon of the tree state (collapsed/expanded), then you can achieve this behaviour with this code snippet.
Just connect the IBAction "toggleUIButtonImage" with the "Touch up inside" event in the IB of your xxxleaf.xib.
Hello,
this is just a little info. If you want that the expand/collapse button of the provided example app shows the according icon of the tree state (collapsed/expanded), then you can achieve this behaviour with this code snippet. Just connect the IBAction "toggleUIButtonImage" with the "Touch up inside" event in the IB of your xxxleaf.xib.
-(IBAction) toggleUIButtonImage:(id)sender{ if ([sender isSelected]) { [sender setImage:[UIImage imageNamed:@"TreeViewSubtreeCollapsedButton.png"] forState:UIControlStateNormal]; [sender setSelected:NO]; }else { [sender setImage:[UIImage imageNamed:@"TreeViewSubtreeExpandedButton.png"] forState:UIControlStateSelected]; [sender setSelected:YES];
}
HTH Johannes