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

关于函数签名的疑问

zhongdom opened this issue · comments

文档明确说明必须按照以下格式声明异步 API

- (void) handler:(id)arg  :(void (^)( id result,BOOL complete))completionHandler)

我在实际使用中,这样声明也是没用问题的

- (void) functionName:(id)arg  hander:(void (^)( id result,BOOL complete))completionHandler)

以上两种申明函数的方式生成的函数签名不一致,然而并不影响使用,是我的理解错了吗?望指点

好吧,看完源码了,函数名只校验第一个 : 之前的字符串,同时同步方法参数只能一个,异步方法参数只能两个。

使用 promt 来传值调用原生代码,有种四两拨千斤的感觉,学习了