1.添加bundle
2.修改
3.设置依赖
4.添加图片到bundle
5.设置bunle宏定义
#define HISUNPLUGIN_BUNDLE_NAME @"HisunSilentlivenessPluginBundle.bundle"
#define HISUNPLUGIN_BUNDLE_PATH [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: HISUNPLUGIN_BUNDLE_NAME]
#define HISUNPLUGIN_MYBUNDLE [NSBundle bundleWithPath: HISUNPLUGIN_BUNDLE_PATH]
6.使用
self.imgview.image = [UIImage imageWithContentsOfFile:[HISUNPLUGIN_MYBUNDLE pathForResource:@"111" ofType:@"png"]];
7.使用bunle添加xib文件
8.xib控制器使用
HisunIdentityAuthenticationViewController *mainVC = [[HisunIdentityAuthenticationViewController alloc] initWithNibName:@"HisunIdentityAuthenticationViewController" bundle:HISUNPLUGIN_MYBUNDLE];
补充: 可能使用如上方法不能成功加载图片,可以更换图片试试,可能本身图片问题导致.