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);

gwb123456 opened this issue · comments

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

你是模拟器吧

OC API 必须符合如下签名:

同步API.

(id) handler:(id) msg

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

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