oc奇怪的語法基礎(chǔ):http://blog.csdn.net/jiangwei0910410003/article/details/41657603
http://blog.csdn.net/gang544043963/article/details/50821700
.h
#ifndef MyLuaoc_h
#define MyLuaoc_h
#import <Foundation/Foundation.h>
@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
關(guān)鍵詞:良辰樂,cocos2d-x,oc