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

[崩溃]: ret=action(JavascriptInterfaceObject,sel,arg); #124

Open
pikacode opened this issue Jun 18, 2020 · 1 comment
Open

[崩溃]: ret=action(JavascriptInterfaceObject,sel,arg); #124

pikacode opened this issue Jun 18, 2020 · 1 comment

Comments

@pikacode
Copy link

你好,我的接口很简单只是弹个 toast

@objc func toast(_ arg: [String: Any]) {
    NotificationBanner.display(arg.values.first as? String)
}

debug 的时候不会崩溃,打包的时候会在这里崩溃

ret=action(JavascriptInterfaceObject,sel,arg);

当我将 release 环境在模拟器运行会崩溃,当我修改了 Build Settings - Optimization Level 改为 None 时,又不会崩溃了。

@jnckjian
Copy link

方法需要返回值,我是返回一个Any?类型的nil

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

2 participants