update website

This commit is contained in:
Travis CI
2015-05-11 23:41:39 +00:00
parent 993d4b64e7
commit ffc7b48baa
+1 -1
View File
@@ -34,7 +34,7 @@ React<span class="token punctuation">.</span>AppRegistry<span class="token punct
</span>
@interface <span class="token class-name">ViewController</span> <span class="token punctuation">(</span><span class="token punctuation">)</span>
@property <span class="token punctuation">(</span>weak<span class="token punctuation">,</span> nonatomic<span class="token punctuation">)</span> IBOutlet ReactView <span class="token operator">*</span>reactView<span class="token punctuation">;</span>
@end</div><p>Here I disabled <strong>AutoLayout</strong> for simplicity. In real production world, you should turn on AutoLayout and setup constraints by yourself.</p><h2><a class="anchor" name="add-rctrootview-to-container-view"></a>Add RCTRootView To Container View <a class="hash-link" href="#add-rctrootview-to-container-view">#</a></h2><p>Ready for the most interesting part? Now we shall create the <code>RCTRootView</code>, where your React Native app lives in.</p><p>In <code>ReactView.m</code>, we need to first initiate <code>RCTRootView</code> with the URI of your <code>index.ios.bundle</code>. <code>index.ios.bundle</code> will be created by packager and served by React Native server, which will be discussed later on.</p><div class="prism language-javascript">NSURL <span class="token operator">*</span>jsCodeLocation <span class="token operator">=</span> <span class="token punctuation">[</span>NSURL URLWithString<span class="token punctuation">:</span>@<span class="token string">&quot;http://localhost:8081/index.ios.bundle&quot;</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">
@end</div><p>Here I disabled <strong>AutoLayout</strong> for simplicity. In real production world, you should turn on AutoLayout and setup constraints by yourself.</p><h2><a class="anchor" name="add-rctrootview-to-container-view"></a>Add RCTRootView To Container View <a class="hash-link" href="#add-rctrootview-to-container-view">#</a></h2><p>Ready for the most interesting part? Now we shall create the <code>RCTRootView</code>, where your React Native app lives.</p><p>In <code>ReactView.m</code>, we need to first initiate <code>RCTRootView</code> with the URI of your <code>index.ios.bundle</code>. <code>index.ios.bundle</code> will be created by packager and served by React Native server, which will be discussed later on.</p><div class="prism language-javascript">NSURL <span class="token operator">*</span>jsCodeLocation <span class="token operator">=</span> <span class="token punctuation">[</span>NSURL URLWithString<span class="token punctuation">:</span>@<span class="token string">&quot;http://localhost:8081/index.ios.bundle&quot;</span><span class="token punctuation">]</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">
// For production use, this `NSURL` could instead point to a pre-bundled file on disk:
</span><span class="token comment" spellcheck="true">//
</span><span class="token comment" spellcheck="true">// NSURL *jsCodeLocation = [[NSBundle mainBundle] URLForResource:@&quot;main&quot; withExtension:@&quot;jsbundle&quot;];