Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override_didMoveToWindow infinite loop when running Xcode 12 and iOS 14 #381

Open
fpaaske opened this issue Oct 27, 2020 · 4 comments
Open

Comments

@fpaaske
Copy link

fpaaske commented Oct 27, 2020

This could be related to #91, #154 or #275, but I'm not sure.
It works fine on Xcode 12 and iOS 13.5.

image

@MichaelYNWA
Copy link

MichaelYNWA commented Nov 9, 2020

I have the same problem xcode12.1 ios14.1
How to resolve?
It works fine on Xcode 12.1 and iOS 13.5.1.
截屏2020-11-09 下午2 37 38

@nicogonza
Copy link

We had the same crash detailed above. This apple forum thread explains what is going on here.

We maintain our own fork since this library is no longer being maintained. You can see the changes we made to work around this crash here.

@mackworth
Copy link

Thank you!

@chenxGen
Copy link

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];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants