dumpView

void dumpView(UIView* aView, NSString* indent) {
   
if (aView) {
       
NSLog(@"%@%@", indent, aView);      // dump this view

       
if (aView.subviews.count > 0) {
           
NSString* subIndent = [[NSString alloc] initWithFormat:@"%@%@",
                           indent
, ([indent length]/2)%2==0 ? @"| " : @": "];
           
for (UIView* aSubview in aView.subviews) dumpView( aSubview, subIndent );
           
[subIndent release];
       
}
   
}
}
posted @ 2011-04-19 17:20  harvey.ding  阅读(178)  评论(0)    收藏  举报