新建一个www文件夹,把它拖入项目内,只要引用,不要选copy,然后把html.js ,css直接放到这个www文件夹下。然后用以下代码加载:

     NSURL* wwwURL  = [NSURL fileURLWithPath :[NSString stringWithFormat:@"%@%@", [[NSBundle mainBundle] bundlePath],@"www"]];///获取www文件夹地址
  

 

///获取www下具体文件地址

  NSString* path = [[NSBundle mainBundle] pathForResource:@"test.js"ofType:nil inDirectory:@"www"];
    NSURL* jsURL = [NSURL fileURLWithPath:path];
   NSLog(@"js的地址是%@",path);

相关文章:

  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2021-12-17
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案