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.
1.95k stars 303 forks source link

崩溃ret=action(JavascriptInterfaceObject,sel,arg); #137

Open gwb123456 opened 3 years ago

gwb123456 commented 3 years ago

ret=action(JavascriptInterfaceObject,sel,arg); ret会返回NSAtom 这回导致后面的if (![NSJSONSerialization isValidJSONObject:dic]) 崩溃 请问怎么处理

foxman2 commented 2 years ago

你是模拟器吧

Geor9eLau commented 2 years ago

OC API 必须符合如下签名:

同步API.

(id) handler:(id) msg

参数可以是任何类型, 但是返回值类型不能为 void。 如果不需要参数,也必须声明,声明后不使用就行。

如果同步API返回值类型为void,调用时则会导致Crash,请务必遵守签名规范。