From d0fce08edecf331f61b938c23af7f67dec096845 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 11 Oct 2023 23:42:49 +0800 Subject: [PATCH] cli: update iOS lib template, fix use framework cannot read bundle from main bundle --- doric-cli/assets-lib/iOS/Classes/TemplateLibrary.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doric-cli/assets-lib/iOS/Classes/TemplateLibrary.m b/doric-cli/assets-lib/iOS/Classes/TemplateLibrary.m index e333786a..5e30d4f3 100644 --- a/doric-cli/assets-lib/iOS/Classes/TemplateLibrary.m +++ b/doric-cli/assets-lib/iOS/Classes/TemplateLibrary.m @@ -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:@"__$__"];