提前加载动态库,反射调用

2020-11-11  本文已影响0人  爱豆一颗心

在用反射调用sdk动态库,发现必须要加载一次,所以备注dlopen提前加载动态库

   NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
   NSString* dlPath = [NSString stringWithFormat: @"%@/Frameworks/###.framework/###", resourcePath];
  const char* cdlpath = [dlPath UTF8String];
  void* hModule = dlopen(cdlpath, RTLD_LAZY); 
  dlclose(hModule);
上一篇 下一篇

猜你喜欢

热点阅读