You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[array replaceObjectsInRange:NSMakeRange(index, 0) withObjectsFromArray:children];
int res = 0;
int i=0;
res += children.count;//start set the children count,then through recursive function to calculate the real child node`s children count.
for (GITreeNode *child in children) {
if (child.directoryIsExpanded) {
//here set a var to save the return value of recursive function.
int count= [self _insertChildren:child.children inArray:array atIndex:index+i+1];
i += count;
res += count;//add return value of recursive function,to solve the crash
// res += child.children.count;
}
i++;
}
return res;
}
The text was updated successfully, but these errors were encountered:
//recursively add children and all its expanded children to array at position index
(int) _insertChildren:(NSArray *)children inArray:(NSMutableArray *)array atIndex:(NSUInteger)index{
[array replaceObjectsInRange:NSMakeRange(index, 0) withObjectsFromArray:children];
int res = 0;
int i=0;
res += children.count;//start set the children count,then through recursive function to calculate the real child node`s children count.
for (GITreeNode *child in children) {
if (child.directoryIsExpanded) {
//here set a var to save the return value of recursive function.
int count= [self _insertChildren:child.children inArray:array atIndex:index+i+1];
i += count;
res += count;//add return value of recursive function,to solve the crash
// res += child.children.count;
}
i++;
}
return res;
}
The text was updated successfully, but these errors were encountered: