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

在 ViewDidLoad 上執行 Segue

Perform Segue on ViewDidLoad(在 ViewDidLoad 上執行 Segue)
本文介紹了在 ViewDidLoad 上執行 Segue的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

在 iOS 5 中,我有一個帶有模式視圖控制器的 Storyboard,如果它是用戶第一次使用應用程序,我想顯示它,之后我想跳過這個視圖控制器.

In iOS 5 I have a Storyboard with a modal view controller, that I would like to display if its the user's first time in the app, after that I would like to skip this view controller.

我設置了一個 NSDefault 鍵來處理這個問題,但是當我檢查它是否已設置然后使用 performSegueWithIdentifier 啟動 segue 時,沒有任何反應.如果我把這個 segue 放在一個按鈕后面,它就可以正常工作......

I set an NSDefault key to handle this but when I check to see if this is set and then use performSegueWithIdentifier to initiate the segue, nothing happens. If i put this segue behind a button it works fine...

推薦答案

我回答了一個類似的問題,開發人員希望在開始時顯示登錄屏幕.我為他整理了一些示例代碼,可以在這里下載.解決這個問題的關鍵是在正確的時間調用東西,如果你想顯示這個新的視圖控制器,你會在例子中看到你必須使用這樣的東西

I answered a similar question where the developer wanted to show a login screen at the start. I put together some sample code for him that can be downloaded here. The key to solving this problem is calling things at the right time if you want to display this new view controller, you will see in the example you have to use something like this

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
    [vc setModalPresentationStyle:UIModalPresentationFullScreen];

    [self presentModalViewController:vc animated:YES];
}

我還對轉場和故事板的工作原理進行了說明,您可以在此處

I also have an explanation of how segues and storyboards work that you can see here

這篇關于在 ViewDidLoad 上執行 Segue的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Using Instruments to test an iOS app without having source code to the application(在沒有應用程序源代碼的情況下使用 Instruments 測試 iOS 應用程序)
KIF: How to auto-run/stress test an iOS app to find the cause of a rare UI bug?(KIF:如何自動運行/壓力測試 iOS 應用程序以找出罕見 UI 錯誤的原因?)
Can#39;t change target membership visibility in Xcode 4.5(無法更改 Xcode 4.5 中的目標成員身份可見性)
UITableView: Handle cell selection in a mixed cell table view static and dynamic cells(UITableView:在混合單元格表視圖靜態和動態單元格中處理單元格選擇)
How to remove Address Bar in Safari in iOS?(如何在 iOS 中刪除 Safari 中的地址欄?)
iOS 5 SDK is gone after upgrade to Xcode 4.5(升級到 Xcode 4.5 后,iOS 5 SDK 消失了)
主站蜘蛛池模板: 婷婷综合在线 | 亚洲高清视频一区 | 天天综合成人网 | 黄色成人在线观看 | 久久高清精品 | 97色伦网| 开操网 | 美女视频一区 | 日韩欧美中文 | 一级中国毛片 | 天天干天天干 | 色婷婷亚洲一区二区三区 | 国产亚洲精品久久久久动 | 中文字幕在线网 | 亚洲精品一区二区三区中文字幕 | 久久视频免费看 | 国产精品一区一区三区 | 九九热在线视频免费观看 | 亚洲狠狠 | 亚洲精品久久久久中文字幕欢迎你 | 国产精品亚洲综合 | 色婷婷狠狠 | 精品自拍视频 | 不卡一二三区 | 日韩不卡一二区 | 国产高清精品在线 | 三级黄色大片网站 | 久久精品国产99国产 | 黑人精品欧美一区二区蜜桃 | 中文字幕在线观看av | 欧美日韩精品免费观看 | jlzzjlzz欧美大全 | 日韩在线免费 | 福利网站在线观看 | 日韩视频精品在线 | 成人伊人 | 欧美福利| 久久不卡日韩美女 | 在线观看视频一区 | av在线视 | 精品欧美黑人一区二区三区 |