-[UIWindow viewForFirstBaselineLayout]: unrecognized selector sent to instance

时间:2023-03-10 01:38:14
-[UIWindow viewForFirstBaselineLayout]: unrecognized selector sent to instance
#ifdef DEBUG

#import <UIKit/UIKit.h>
#import <objc/runtime.h> @implementation UIView (FixViewDebugging) + (void)load
{
Method original = class_getInstanceMethod(self, @selector(viewForBaselineLayout));
class_addMethod(self, @selector(viewForFirstBaselineLayout), method_getImplementation(original), method_getTypeEncoding(original));
class_addMethod(self, @selector(viewForLastBaselineLayout), method_getImplementation(original), method_getTypeEncoding(original));
} @end #endif

参考链接:

http://*.com/questions/36313850/debug-view-hierarchy-in-xcode-7-3-fails