cli: update iOS lib template, fix use framework cannot read bundle from main bundle

This commit is contained in:
pengfei.zhou 2023-10-11 23:42:49 +08:00 committed by osborn
parent 89023368b5
commit d0fce08ede

View File

@ -3,7 +3,7 @@
@implementation __$RawName__Library
- (void)load:(DoricRegistry *)registry {
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *path = [NSBundle bundleForClass:self.class].bundlePath;
NSString *fullPath = [path stringByAppendingPathComponent:@"bundle___$__.js"];
NSString *jsContent = [NSString stringWithContentsOfFile:fullPath encoding:NSUTF8StringEncoding error:nil];
[registry registerJSBundle:jsContent withName:@"__$__"];