Is there a way to find out how many views are currently in the view-stack? Just curious to see how big its getting at any point when the code is pushing one view onto another...
Asked
Active
Viewed 166 times
1 Answers
0
You should be able to add your own support for counting subviews recursively using a category on UIView:
@implementation UIView (SubviewCount)
- (NSUInteger)subviewCount
{
NSUInteger count = [[self subviews] count];
for (UIView *view in [self subviews])
count += [view subviewCount];
return count;
}
@end

Todd Yandell
- 14,656
- 2
- 50
- 37
-
ok - but what does this mean: "using a category on UIView"? What is a category? – Sirab33 Jul 13 '11 at 12:52