cocos creator 1.7 js调用oc 不支持number类型参数,creator 1.7 js调用oc带int参数出错,unsupported argument type: @

creator 1.7 js调用oc带int参数出错,unsupported argument type @

自己回答吧,JavaScriptObjcBridge::CallInfo::execute里114行arg.isNumber()类型分支里添加一个else if,
else if (argumentType == @encode(id))
{
double val = arg.toNumber();
id num=[NSNumber numberWithFloat:val];
[invocation setArgument:&num atIndex:i];
}
按照1.6写的
cocos用得真不省心,改了他们也不试一下能不能用

2赞

谢了兄弟,帮大忙了

js调用oc 返回类型是 NSString类型的 怎么写