用[[NSBundle mainBundle] resourcePath]获取res目录 然后再前面加入该路径即可,比如:NSString* filepath=[NSString stringWithFormat:@"%@/%s",[[NSBundle mainBundle] resourcePath], luafilename]; luaL_dofile(filepath);
用[[NSBundle mainBundle] resourcePath]获取res目录
然后再前面加入该路径即可,比如:
NSString* filepath=[NSString stringWithFormat:@"%@/%s",[[NSBundle mainBundle] resourcePath], luafilename];
luaL_dofile(filepath);