Open fpaaske opened 4 years ago
I have the same problem xcode12.1 ios14.1 How to resolve? It works fine on Xcode 12.1 and iOS 13.5.1.
Thank you!
Try to replace override_didMoveToWindow
method in UIView+NUI.m with code below, it works for me.
- (void)override_didMoveToWindow
{
if (self.class != [UIView class]) {
Method currentMethod = class_getInstanceMethod(self.class, @selector(override_didMoveToWindow));
Method expectedMethod = class_getInstanceMethod([UIView class], @selector(override_didMoveToWindow));
if (currentMethod && expectedMethod) {
/// Both subclass and UIView override method override_didMoveToWindow,
/// In this case, just invoke method of UIView(original implementation of `didMoveToWindow`).
if (currentMethod != expectedMethod) {
((void (*)(id, Method))method_invoke)(self, expectedMethod);
return;
}
}
}
if (!self.isNUIApplied) {
[self applyNUI];
}
[self override_didMoveToWindow];
}
This could be related to #91, #154 or #275, but I'm not sure. It works fine on Xcode 12 and iOS 13.5.