alibaba / wax

Wax is a framework that lets you write native iPhone apps in Lua.
http://github.com/probablycorey/wax
MIT License
1.84k stars 280 forks source link

在lua中怎么解析OC中的自定义类型呢? #19

Closed limost closed 8 years ago

limost commented 8 years ago

自定义类型为BookInfo包括NSDictionary类型的menu(目录)和NSString类型的name(名字)。 代码如下: local gBookInfo = BookInfo:sharedInstance() --gBookInfo是userdata(用户自定义)类型 在Lua中通过BookInfo中的ShareInstance方法,取得实体。现在我需要在Lua中解析gBookInfo的menu字段,却找不到合适的方法。求解答,万分感谢!!!

intheway commented 8 years ago

what would you write in OC? gBookInfo.menu , gBookInfo.name so in lua local menu = gBookInfo: menu() local name = gBookInfo:name() learn more , see wiki

limost commented 8 years ago

Thanks