lua调用oc - luaoc.callStaticMethod

oc奇怪的语法基础:http://blog.csdn.net/jiangwei0910410003/article/details/41657603
http://blog.csdn.net/gang544043963/article/details/50821700

.h

#ifndef MyLuaoc_h
#define MyLuaoc_h
#import 

@interface OCClass : NSObject{
}

+ (NSString *)getNum:(NSDictionary *)dic;

@end
#endif /* MyLuaoc_h */

.m

#import "MyLuaoc.h"
@implementation OCClass
+ (NSString *)getNum:(NSDictionary *)dic {
    NSLog(@"hi888");
    return @"111";
}
@end

lua

local function LCfunc()  
    print("callBack succeed")  
end

function ocgo( )
    local arg1 = {callBack = LCfunc}
    local arg2 = {types = 1,maxCount = 4,original = 1}  
    result, version = luaoc.callStaticMethod("OCClass", "getNum", arg1)  
end

关键词:良辰乐,cocos2d-x,oc

你可能感兴趣的:(lua调用oc - luaoc.callStaticMethod)