老师,我的Appdelegate.m文件和你的内容不一样。
来源:7-7 如何在手机上安装演示 RN 原型项目
毛桃_我叫MT
2017-04-17
rn版本^0.42.3。
没有jscodeLocation
* LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import "AppDelegate.h" #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURL *jsCodeLocation; jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"imooc" 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; [self.window makeKeyAndVisible]; return YES; } @end
写回答
1回答
-
Scott
2017-04-17
对, RN 版本一直升的,不同版本可能就会不同,你先往下面看课程吧,安装手机这一节如果没成功,可以先跳过往下面走,跟完课程回头来研究
012017-04-18
相似问题