mac下真机不能reload

2019-11-01  本文已影响0人  glenlg

失败!! 待后续更新

1.终端显示 bogon,怀疑找不到主机名造成.修改hosts文件映射,不成功.
2.可能Bridge存在bug,替换如下,成功reload.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  NSURL* jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  
  [[RCTBundleURLProvider sharedSettings] setJsLocation:jsCodeLocation.host];
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"bookmanager"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
//  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
//                                                   moduleName:@"bookmanager"
//                                            initialProperties:nil];
上一篇下一篇

猜你喜欢

热点阅读