mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3' of https://github.com/shinhirota/cocos2d-x into callStaticMethodWithBool
This commit is contained in:
commit
d6c039f528
|
@ -111,9 +111,19 @@ bool JavaScriptObjCBridge::CallInfo::execute(JSContext *cx,jsval *argv,unsigned
|
|||
if(m_dic != nil){
|
||||
for(int i = 2;i<m_dic.count+2;i++){
|
||||
id obj = [m_dic objectForKey:[NSString stringWithFormat:@"argument%d",i-2] ];
|
||||
|
||||
if ([obj isKindOfClass:[NSNumber class]] &&
|
||||
((strcmp([obj objCType], "c") == 0 || strcmp([obj objCType], "B") == 0))) //BOOL
|
||||
{
|
||||
bool b = [obj boolValue];
|
||||
[invocation setArgument:&b atIndex:i];
|
||||
}
|
||||
else
|
||||
{
|
||||
[invocation setArgument:&obj atIndex:i];
|
||||
}
|
||||
}
|
||||
}
|
||||
NSUInteger returnLength = [methodSig methodReturnLength];
|
||||
const char *returnType = [methodSig methodReturnType];
|
||||
[invocation invoke];
|
||||
|
|
Loading…
Reference in New Issue