iphone - iOS:有条件地加载 View Controller
<p><p>有没有办法从 App Delegate 有条件地加载 ViewController ?</p>
<p>例如,可以这样做吗?</p>
<pre><code> if (hasUserSignedUp) {
nav = [ initWithNibName:nil bundle:nil];
;
;
}
else {
su = [ initWithNibName:nil bundle:nil];
;
;
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>是的,这很方便,您这样做没有任何限制。</p>
<p>但我认为你最好设置 rootViewController 而不是添加 View 。</p>
<pre><code>self.window.rootViewController = nav;//or su;
</code></pre></p>
<p style="font-size: 20px;">关于iphone - iOS:有条件地加载 ViewController ,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/10149592/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/10149592/
</a>
</p>
页:
[1]