wendux / DSBridge-IOS

:earth_asia: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

pikacode opened this issue · comments

你好,我的接口很简单只是弹个 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 时,又不会崩溃了。

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