pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <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="mca02g2" 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="8q222oo" 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="miyyyik" id='vnp0N'><tfoot id='vnp0N'></tfoot><dl id='vnp0N'><fieldset id='vnp0N'></fieldset></dl></div>
                          1. <small id='vnp0N'></small><noframes id='vnp0N'>

                          2. 主站蜘蛛池模板: sus630/303cu不锈钢棒,440C/430F/17-4ph不锈钢研磨棒-江苏德镍金属科技有限公司 | 深圳彩钢板_彩钢瓦_岩棉板_夹芯板_防火复合彩钢板_长鑫 | 通用磨耗试验机-QUV耐候试验机|久宏实业百科 | 学叉车培训|叉车证报名|叉车查询|叉车证怎么考-工程机械培训网 | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 加气混凝土砌块设备,轻质砖设备,蒸养砖设备,新型墙体设备-河南省杜甫机械制造有限公司 | 北京租车公司_汽车/客车/班车/大巴车租赁_商务会议/展会用车/旅游大巴出租_北京桐顺创业租车公司 | 石家庄律师_石家庄刑事辩护律师_石家庄取保候审-河北万垚律师事务所 | ALC墙板_ALC轻质隔墙板_隔音防火墙板_轻质隔墙材料-湖北博悦佳 | 铝单板_铝窗花_铝单板厂家_氟碳包柱铝单板批发价格-佛山科阳金属 | 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | 便携式XPDM露点仪-在线式防爆露点仪-增强型烟气分析仪-约克仪器 冰雕-冰雪世界-大型冰雕展制作公司-赛北冰雕官网 | 河南中整光饰机械有限公司-抛光机,去毛刺抛光机,精密镜面抛光机,全自动抛光机械设备 | 水质监测站_水质在线分析仪_水质自动监测系统_多参数水质在线监测仪_水质传感器-山东万象环境科技有限公司 | 防火窗_耐火窗_防火门厂家_防火卷帘门-重庆三乐门业有限公司 | 浙江富广阀门有限公司| 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | 顺辉瓷砖-大国品牌-中国顺辉| 东莞市踏板石餐饮管理有限公司_正宗桂林米粉_正宗桂林米粉加盟_桂林米粉加盟费-东莞市棒子桂林米粉 | 金蝶帐无忧|云代账软件|智能财税软件|会计代账公司专用软件 | 不发火防静电金属骨料_无机磨石_水泥自流平_修补砂浆厂家「圣威特」 | 模具硅橡胶,人体硅胶,移印硅胶浆厂家-宏图硅胶科技 | 事迹材料_个人事迹名人励志故事 学生作文网_中小学生作文大全与写作指导 | 电动球阀_不锈钢电动球阀_电动三通球阀_电动调节球阀_上海湖泉阀门有限公司 | 泥沙分离_泥沙分离设备_泥砂分离机_洛阳隆中重工机械有限公司 | 餐饮小吃技术培训-火锅串串香培训「何小胖培训」_成都点石成金[官网] | 复合肥,化肥厂,复合肥批发,化肥代理,复合肥品牌-红四方 | 锂电池砂磨机|石墨烯砂磨机|碳纳米管砂磨机-常州市奥能达机械设备有限公司 | 铸铝门厂家,别墅大门庭院大门,别墅铸铝门铜门[十大品牌厂家]军强门业 | 老城街小面官网_正宗重庆小面加盟技术培训_特色面馆加盟|牛肉拉面|招商加盟代理费用多少钱 | 济南玻璃安装_济南玻璃门_济南感应门_济南玻璃隔断_济南玻璃门维修_济南镜片安装_济南肯德基门_济南高隔间-济南凯轩鹏宇玻璃有限公司 | 浙江华锤电器有限公司_地磅称重设备_防作弊地磅_浙江地磅售后维修_无人值守扫码过磅系统_浙江源头地磅厂家_浙江工厂直营地磅 | 东莞画册设计_logo/vi设计_品牌包装设计 - 华略品牌设计公司 | 模温机-油温机-电加热导热油炉-工业冷水机「欧诺智能」 | 离子色谱自动进样器-青岛艾力析实验科技有限公司 | 插针变压器-家用电器变压器-工业空调变压器-CD型电抗器-余姚市中驰电器有限公司 | 土壤有机碳消解器-石油|表层油类分析采水器-青岛溯源环保设备有限公司 | COD分析仪|氨氮分析仪|总磷分析仪|总氮分析仪-圣湖Greatlake | 专业生物有机肥造粒机,粉状有机肥生产线,槽式翻堆机厂家-郑州华之强重工科技有限公司 | arch电源_SINPRO_开关电源_模块电源_医疗电源-东佑源 | 碎石机设备-欧版反击破-欧版颚式破碎机(站)厂家_山东奥凯诺机械 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 |