0

Goal:

Get the view hierarchy into an instance of the NSString

Code:

+ (void)dumpViewHierarchy {
    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    NSString *recursive = [keyWindow recursiveDescription];
} 

Error:

No visible @interface for 'UIWindow' declares the selector 'recursiveDescription'

enter image description here

Richard Topchii
  • 7,075
  • 8
  • 48
  • 115

1 Answers1

0

That is because uiwindow does not have any method named recursiveDescription. Probably you can use description property to print the description.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
nishith Singh
  • 2,968
  • 1
  • 15
  • 25