久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='GhFIh'><style id='GhFIh'><dir id='GhFIh'><q id='GhFIh'></q></dir></style></legend>
      <i id='GhFIh'><tr id='GhFIh'><dt id='GhFIh'><q id='GhFIh'><span id='GhFIh'><b id='GhFIh'><form id='GhFIh'><ins id='GhFIh'></ins><ul id='GhFIh'></ul><sub id='GhFIh'></sub></form><legend id='GhFIh'></legend><bdo id='GhFIh'><pre id='GhFIh'><center id='GhFIh'></center></pre></bdo></b><th id='GhFIh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GhFIh'><tfoot id='GhFIh'></tfoot><dl id='GhFIh'><fieldset id='GhFIh'></fieldset></dl></div>
      <tfoot id='GhFIh'></tfoot>

      <small id='GhFIh'></small><noframes id='GhFIh'>

      • <bdo id='GhFIh'></bdo><ul id='GhFIh'></ul>

      1. 在應用程序啟動時從情節提要中選擇替代的第一

        selecting alternative first view controller from story board at application startup(在應用程序啟動時從情節提要中選擇替代的第一個視圖控制器)

          <tbody id='IjUho'></tbody>

          <bdo id='IjUho'></bdo><ul id='IjUho'></ul>
        • <legend id='IjUho'><style id='IjUho'><dir id='IjUho'><q id='IjUho'></q></dir></style></legend>
          • <small id='IjUho'></small><noframes id='IjUho'>

            • <i id='IjUho'><tr id='IjUho'><dt id='IjUho'><q id='IjUho'><span id='IjUho'><b id='IjUho'><form id='IjUho'><ins id='IjUho'></ins><ul id='IjUho'></ul><sub id='IjUho'></sub></form><legend id='IjUho'></legend><bdo id='IjUho'><pre id='IjUho'><center id='IjUho'></center></pre></bdo></b><th id='IjUho'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IjUho'><tfoot id='IjUho'></tfoot><dl id='IjUho'><fieldset id='IjUho'></fieldset></dl></div>

            • <tfoot id='IjUho'></tfoot>

                  本文介紹了在應用程序啟動時從情節提要中選擇替代的第一個視圖控制器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我剛剛開始使用 iOS 編程,到目前為止,我在這里找到的教程和答案對我前進有很大幫助.然而,這個特殊的問題讓我整晚都在煩惱,我找不到感覺正確"的答案.

                  I've just started on iOS programming and so far the tutorials and answers I found here have been a great help to move forward. However, this particular problem has been bumming me all night and I can't find an answer that "feels right".

                  我正在編寫一個連接到遠程服務的應用程序,用戶需要先登錄才能使用它.當他們開始使用應用程序時,他們的第一個視圖應該是登錄對話框;當他們之前進行過身份驗證時,他們會立即看到概覽頁面.

                  I'm writing an application that connects to a remote service and the users need to sign in before they can use it. When they start using the application, their first view should be the sign in dialog; when they've authenticated before, they immediately see the overview page.

                  該項目使用故事板——我認為這是一個很棒的特性——所以選擇和加載根視圖控制器的大部分代碼都已經處理好了.我認為添加邏輯的最佳位置是 AppDelegate:

                  The project uses story boards - which I think is a great feature - so most of the code that selects and loads the root view controller is already taken care of. I thought the best place to add my logic is the application:didFinishLaunchingWithOptions: method of the AppDelegate:

                  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
                        (NSDictionary *)launchOptions
                  {
                      // select my root view controller here based on credentials present or not
                      return YES;
                  }
                  

                  但這帶來了兩個問題:

                  1. 在這個特定的委托方法中,根視圖控制器已經根據故事板被選擇(并加載?).我是否可以在加載過程中移到更早的位置以覆蓋第一個視圖控制器選擇,或者這會使事情變得不必要地復雜化?

                  1. Inside this particular delegate method, the root view controller has already been selected (and loaded?) based on the story board. Could I move to an earlier spot in the loading process to override the first view controller selection or would that needlessly complicate matters?

                  要覆蓋第一個視圖控制器,我需要引用故事板,但我找不到比使用 storyboardWithName:bundle: 構造函數更好的方法UIStoryboard.感覺不對,應用程序應該已經有故事板的引用,但是我怎么才能訪問它呢?

                  To override the first view controller I need a reference to the story board, but I couldn't find a better way than to use the storyboardWithName:bundle: constructor of UIStoryboard. That feels wrong, the application should already have a reference to the story board, but how can I access it?

                  更新

                  我解決了我遇到的第二個問題,因為我在這里找到了答案:

                  I worked out the second issue I was having, as I found my answer here:

                  UIStoryboard:獲取活躍的故事板?

                  NSBundle *bundle = [NSBundle mainBundle];
                  NSString *sbFile = [bundle objectForInfoDictionaryKey:@"UIMainStoryboardFile"];
                  UIStoryboard *sb = [UIStoryboard storyboardWithName:sbFile bundle:bundle];
                  

                  以上將創建一個新的故事板實例;要獲取活動實例,要簡單得多:

                  The above will create a new story board instance; to get the active instance, it's a whole lot simpler:

                  UIStoryboard *sb = [[self.window rootViewController] storyboard];
                  

                  在故事板文件本身中,您必須為要加載的視圖設置標識符,例如登錄對話框.然后你像這樣實例化視圖:

                  In the story board file itself you have to set an identifier for the view you wish to load, e.g. LoginDialog. Afterwards you instantiate the view like this:

                  LoginViewController *login = [sb instantiateViewControllerWithIdentifier:@"LoginDialog"];
                  [self.window setRootViewController:login];
                  

                  在另一個視圖控制器中,以下就足夠了:

                  Within another view controller, the following suffices:

                  UIStoryboard *sb = self.storyboard;
                  LoginViewController *login = [sb instantiateViewControllerWithIdentifier:@"LoginDialog"];
                  [self presentViewController:login animated:NO completion:nil];
                  

                  推薦答案

                  只需重置窗口的根視圖控制器即可

                  You can just reset the root view controller of the window

                  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
                        (NSDictionary *)launchOptions
                  {
                     if(your_condition) {
                         UIViewController *newRoot = [your implementation];
                         self.window.rootViewController = newRoot;
                     }
                     return YES;
                  }
                  

                  這對我有用,Xcode5.0.1

                  This is worked for me, Xcode5.0.1

                  這篇關于在應用程序啟動時從情節提要中選擇替代的第一個視圖控制器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標已經包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))

                    <bdo id='vnp0N'></bdo><ul id='vnp0N'></ul>
                    • <legend id='vnp0N'><style id='vnp0N'><dir id='vnp0N'><q id='vnp0N'></q></dir></style></legend>

                            <tbody id='vnp0N'></tbody>

                          <tfoot id='vnp0N'></tfoot>
                          <i id='vnp0N'><tr id='vnp0N'><dt id='vnp0N'><q id='vnp0N'><span id='vnp0N'><b id='vnp0N'><form id='vnp0N'><ins id='vnp0N'></ins><ul id='vnp0N'></ul><sub id='vnp0N'></sub></form><legend id='vnp0N'></legend><bdo id='vnp0N'><pre id='vnp0N'><center id='vnp0N'></center></pre></bdo></b><th id='vnp0N'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vnp0N'><tfoot id='vnp0N'></tfoot><dl id='vnp0N'><fieldset id='vnp0N'></fieldset></dl></div>
                          1. <small id='vnp0N'></small><noframes id='vnp0N'>

                          2. 主站蜘蛛池模板: 久久精品国产亚洲一区二区 | 高清久久久 | 欧美精品一区在线发布 | 天堂色综合 | 亚洲欧美综合精品久久成人 | 国产日韩视频 | 欧美视频网 | 在线一区二区三区 | 免费视频一区二区 | 国产四虎 | 日韩在线| 男女午夜激情视频 | 美女天天操| 日本一区二区高清视频 | 久久久久久网站 | 久久久久久电影 | 91视频精选 | 精品欧美在线观看 | 国产成人精品一区二三区在线观看 | 色av一区二区 | 亚洲一二三区av | 97国产精品| 国产乱码精品一区二区三区中文 | 在线免费观看黄色网址 | 欧美一级免费黄色片 | 欧美日韩亚洲国产综合 | 欧美日韩高清在线一区 | 亚洲性人人天天夜夜摸 | 欧美在线视频一区二区 | www.久久 | 91大神在线资源观看无广告 | 成年人网站在线观看视频 | 在线免费观看成人 | 视频精品一区 | 人人99 | 久久久成人精品 | 91网站在线观看视频 | www.性色 | 不卡一区二区三区四区 | 欧美精品在线一区二区三区 | 成人网av|