美文网首页
mac下真机不能reload

mac下真机不能reload

作者: glenlg | 来源:发表于2019-11-01 18:14 被阅读0次

    失败!! 待后续更新

    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];
    

    相关文章

      网友评论

          本文标题:mac下真机不能reload

          本文链接:https://www.haomeiwen.com/subject/xvrdyctx.html