当前位置: 移动技术网 > 移动技术>移动开发>IOS > iOS 加载Bundle文件的实例代码

iOS 加载Bundle文件的实例代码

2019年07月24日  | 移动技术网移动技术  | 我要评论

废话不多说了,下面通过一段代码给大家介绍ios 加载bundle文件的方法,具体代码如下所示:

- (nsstring *)loadjsfile:(nsstring *)filename type:(nsstring *)type{
  nsstring *path = [[nsbundle mainbundle] pathforresource:filename oftype:type];
  nsstring *string1 = [nsstring stringwithcontentsoffile:path encoding:nsutf8stringencoding error:nil];
  nsstring *string1 = [nsstring stringwithcontentsofurl:[nsurl urlwithstring:path] encoding:nsutf8stringencoding error:nil];
  return jsscript;
}

以上所述是小编给大家介绍的ios 加载bundle文件的实例代码,希望对大家有所帮助

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网