React-native Demo (1)

Source: Internet
Author: User


Today put react native environment to complete, and then run a small demo to try.
First Environmental configuration & Hello World Summary



According to the above study article, I basically completed, but in the configuration process encountered 2 problems, need to end. node is installed



Since I installed react-native before I installed node, we would have an error when executing, this is because react-native is using io.js, This time we need to install io.js, and you have to delete node, I follow the tutorial on the solution using Brew unlink node, to remove the reference to node, and then install IOJS, but the use of sudo brew link Iojs--force will be error:


58demacbook-pro:react-native wuxian$ sudo brew link iojs--force
linking/usr/local/cellar/iojs/2.5.0 ... 
Error:could not symlink bin/node
Target/usr/local/bin/node
already exists. Want to remove it:
  rm '/usr/local/bin/node ' to force the

link and overwrite all conflicting files:
  bre W link--overwrite iojs to

list all files, would be deleted:
  brew link--overwrite--dry-run iojs
Workaround


This time we're going to use sudo brew link--overwrite iojs--force to cover node. js with Iojs. error for null pointer



After I initialize a HelloWorld project, I get an error and report a null pointer.


Nsurlsessiondownloadtask *task = [_urlsession downloadtaskwithurl:url completionhandler:nil];





I changed it to an empty implementation:


 NSURLSessionDownloadTask *task = [_URLSession downloadTaskWithURL:url completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error){
  }];


The program is running successfully.






Then I found another solution to the problem on GitHub



It is correct to delete the Completionhandler:nil of the method after it becomes the following form:


Nsurlsessiondownloadtask *task = [_urlsession Downloadtaskwithurl:url];
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.