alibaba/wax

import <ObjectiveGumbo.h> 这种导入方式在 wax 里应该怎么写?

Closed this issue · 2 comments

ObjectiveGumbo 是用 pod 安装的一个库,在 oc 里 import <ObjectiveGumbo.h> 这样导入没问题,但在 .lua 文件中写 require "ObjectiveGumbo.h"require "ObjectiveGumbo" 均报错:

Error opening wax scripts: ParserController.lua:1: module 'ObjectiveGumbo.h' not found:
    no field package.preload['ObjectiveGumbo.h']
    no file 'scripts/ObjectiveGumbo/h.lua'
    no file 'scripts/ObjectiveGumbo/h/init.lua'
    no file 'scripts/ObjectiveGumbo/h.dat'
    no file 'ObjectiveGumbo/h.lua'
    no file 'ObjectiveGumbo/h/init.lua'
    no file 'ObjectiveGumbo/h.dat'

是写法问题还是因为不在文件搜索路径里?

In wax, all Objective-c class can be called directly. There is no need to import head file.
Just use like.

local NSUTF8StringEncoding = 4
local doc = ObjectiveGumbo:parseDocumentWithData_encoding(data , NSUTF8StringEncoding)

@intheway It works, thanks!