Problem: I debugCodeWhen a function is called, the result of one-step debugging cannot enter the function.
The following code is used:
-(Void) passvalue :( nsarray *) secondnodesarray
{
Treeviewcell * cell = (treeviewcell *) [self. tableview cellforrowatindexpath: indexpathcopy];
[Cell onexpandcell];
}
-(Void) onexpandcell
{
[Self expand];
}
-(Void) Expand
{
Nslog (@ "Expand ");
If ([treenode haschildren]) {// If a subnode exists
Treenode. Expanded =! Treenode. Expanded; // switch the "Expand/collapse" status
If (treenode. Expanded) {// If the expanded status is set, set the "+/-" icon.
[Btnexpand setimage: [uiimage imagenamed:
@ "Minustree.png"] forstate: uicontrolstatenormal];
} Else {
[Btnexpand setimage: [uiimage imagenamed:
@ "Plustree.png"] forstate: uicontrolstatenormal];
}
If (owner! = Nil & onexpand! = Nil) // If the onexpand attribute is set, call
[Owner login mselector: onexpand withobject: treenode];
}
}
The red code is the breakpoint I set, and the result cannot be run into the expand function.
Summary (ProgramThe reason is that the object is not created and cannot be executed in the function.
That is to say
Treeviewcell * cell = (treeviewcell *) [self. tableview cellforrowatindexpath: indexpathcopy]; not created successfully.