Skip to content

Commit c89c88e

Browse files
author
LiuKeNan
committedJan 4, 2018
https://github.com/u0u0/Quick-Cocos2dx-Community/issues/99
1 parent dc45a0d commit c89c88e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎cocos/scripting/lua-bindings/manual/platform/ios/CCLuaObjcBridge.mm

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,25 @@
122122
lua_pushboolean(L, 1);
123123
if (returnLength > 0)
124124
{
125-
if (strcmp(returnType, "@") == 0)
125+
if (strcmp(returnType, @encode(id)) == 0)
126126
{
127127
id ret;
128128
[invocation getReturnValue:&ret];
129129
pushValue(L, ret);
130130
}
131-
else if (strcmp(returnType, "B") == 0) // BOOL
131+
else if (strcmp(returnType, @encode(BOOL)) == 0) // BOOL
132132
{
133133
char ret;
134134
[invocation getReturnValue:&ret];
135135
lua_pushboolean(L, ret);
136136
}
137-
else if (strcmp(returnType, "i") == 0) // int
137+
else if (strcmp(returnType, @encode(int)) == 0) // int
138138
{
139139
int ret;
140140
[invocation getReturnValue:&ret];
141141
lua_pushinteger(L, ret);
142142
}
143-
else if (strcmp(returnType, "f") == 0) // float
143+
else if (strcmp(returnType, @encode(float)) == 0) // float
144144
{
145145
float ret;
146146
[invocation getReturnValue:&ret];

0 commit comments

Comments
 (0)