美文网首页
iOS自制framework需要读取本地bundle

iOS自制framework需要读取本地bundle

作者: 一天天的啊哈哈 | 来源:发表于2020-05-29 15:05 被阅读0次

记录一下,注意修改bundle的文件名

- (void)loadScriptAtPath:(NSString *)path {
    NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"bundleName" ofType:@"bundle"]];
    NSString *script = [NSString stringWithContentsOfFile:[bundle pathForResource:@"fileName" ofType:@"fileType"] encoding:NSUTF8StringEncoding error:NULL];
}

相关文章

网友评论

      本文标题:iOS自制framework需要读取本地bundle

      本文链接:https://www.haomeiwen.com/subject/lmnxzhtx.html