十一岁的加重songxing10000…… ------ 回到博主首页

-[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://stackoverflow.com/questions/36313850/debug-view-hierarchy-in-xcode-7-3-fails

posted @ 2016-07-28 22:02  songxing10000  阅读(795)  评论(0编辑  收藏  举报