简体   繁体   中英

RNBLueModalView throws lldb error

I'm using RNBLueModalView for presenting new modal view with following code:

    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
    smallStoreViewController *Store = [[smallStoreViewController alloc]init];

    Store = [storyBoard instantiateViewControllerWithIdentifier:@"small store"];

    RNBlurModalView *mod = [[RNBlurModalView alloc] initWithViewController:self view:Store.view];

    [mod show];

There's six buttons in smallStoreViewController view, but when i pressed at any of them i'm getting lldb exception - (button name) unrecognized selector sent to instance. Everything is working fine when i use default ( presentedViewController method) presenting of modal view. This is pretty strange behaviour, because i'm used this approach in my previous project, and all was working fine.

Any advice of where i can find the reason of this exception?

So i find the solution: I should've keep the strong reference of my smallStoreViewController . I guess error happening because of assigning it to Store as a local variable, and it's not around when button of modal view is pressed. (The error shows that memory has been released and re-used for a different type of object.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM