首页 > 其他 > 详细

React – Native 踩坑记

时间:2016-06-30 14:10:45      阅读:147      评论:0      收藏:0      [点我收藏+]

 

  1. 运行的时候先报错说can’t be opened because it is from an unidentified developer,这是osx自己安全设置搞太高,去安全选项改了(allow apps download from anywhere)之后。又报错说permission问题,于是在终端用(chmod -R 755 /项目根目录)(主意:755后面一定要加空格)把所有文件都改成755权限,然后就可以完美运行了。
  2. 用模拟器和真机调试时,环境不同,在工程AppDelegate.m的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中:模拟器调试时用jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];真机调试时用jsCodeLocation = [NSURL URLWithString:@"http://10.18.51.27:8081/index.ios.bundle?platform=ios&dev=true"];
  3. 找不到sever,没有注册 : 项目根目录下运行 react-native start
  4. cocoaPods 集成第三方库,编译报错 symbol(s) not found for architecture arm64 在other linker Flags 中添加 $(inherited)
  5. cocoaPods 找不到头文件 在user header search path 中添加$(SRCART)
  6. 当属性为函数引用时,如果该引用函数中有用到this,需要用bind方法将this传递进去
  7. 另外一直解决方案是:
    文件: RCTWrapperViewController.m
    方法: - (void)viewWillAppear:(BOOL)animated
    插入下面一句

self.navigationController.tabBarController.tabBar.hidden=self.navigationController.childViewControllers.count>1?YES:NO;

 

React – Native 踩坑记

原文:http://www.cnblogs.com/cqj123/p/5629751.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!