废话不多说了,下面通过一段代码给大家介绍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文件的实例代码,希望对大家有所帮助
如对本文有疑问, 点击进行留言回复!!
APP调用微信小程序,能拉起小程序,但是onResp回调不会被调用问题
Codeforces Round #657 (Div. 2) B. Dubious Cyrpto(思维,数学)
网友评论