- 首页 > it技术 > >
RCTBridge|RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
#ifdef DEBUGjsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#elsejsCodeLocation = [CodePush bundleURL];
#endifRCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocationmoduleProvider:nillaunchOptions:launchOptions];
#if RCT_DEV[bridge moduleForClass:[RCTDevLoadingView class]];
#endifRCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridgemoduleName:@"ProjectName"initialProperties:nil];
//RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation//moduleName:@"ProjectName"//initialProperties:nil//launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
推荐阅读