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

OC Swift混编调用MGJRouterParameterCompletion报错 #8

Open
yiyj opened this issue Dec 24, 2021 · 0 comments
Open

OC Swift混编调用MGJRouterParameterCompletion报错 #8

yiyj opened this issue Dec 24, 2021 · 0 comments

Comments

@yiyj
Copy link

yiyj commented Dec 24, 2021

OC中注册

  • (void)load
    {
    [MGJRouter registerWithHandler:Router_Tab :^(NSDictionary<NSString *,id> * _Nullable routerParameters) {
    NSInteger index = (NSInteger)routerParameters[@"index"];
    [CYLPlusButtonSubclass registerPlusButton];
    CYLTabBarControllerConfig *tabBarControllerConfig = [[CYLTabBarControllerConfig alloc] init];
    CYLTabBarController *tabBarController = tabBarControllerConfig.tabBarController;
    tabBarController.delegate = (id )kAppDelegate;
    tabBarController.selectedIndex = index;
    [kAppDelegate.window setRootViewController:tabBarController];
    void(^completion)(id result) = routerParameters[@"MGJRouterParameterCompletion"];
    completion(@"completion");
    }];
    }

swift 中调用open
MGJRouter.open(Router_Tab) { result in
print(res)
}

在OC中completion(@"xxxx")报错 Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
截屏2021-12-24 下午4 02 52

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

1 participant