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