我有一個故事板有一個ViewController DefaultViewController
既不是UITabBarController
也不'UINavigationController`。它決定即將到來的控制器是否應該是註冊屏幕或主屏幕。performSegueWithIdentifier:發件人不工作在設備上
我有兩個來自它的segues,一個指向UINavigationController' that does registration while other moves to 'UITabBarController
這是默認的主屏幕。
的DefaultViewController
電話並按照ViewDidAppear:
方法
NSString *theController = nil;
if ([AppState sharedAppState].currentUserState == Registered) {
theController = @"HomeSegue";
} else {
theController = @"RegSegue";
}
[self performSegueWithIdentifier:theController sender:self];
上iPhone模擬器5.1.1以及6.0進行SEGUE良好。但是,當我在iOS 5.1.1上運行代碼或在iOS 6.0上運行iPhone時,沒有任何反應。該視圖保持與DefaultViewController
的視圖。
編輯 我創建全新的項目和工作正常那裏,但是當我複製老故事板內容和課程,問題再次出現.. !!
**編輯2 ** 我刪除了與UINavigationController相關聯的RootViewController,並添加了一個簡單的UIViewController,它上面有一個標籤,它工作正常。如果我將自定義RegistrationController作爲根控制器添加,則不執行segue。
P.S.我的自定義RegistrationController
在其中添加了另一個控制器作爲childViewController。
這是工作正常的另一天! – tGilani 2013-02-19 11:00:41
當然你已經放置了斷點,所以你可以跨越代碼,看看哪一行不工作?例如,您可能在segue名稱中鍵入了錯誤,因此嘗試重新創建segue時,要知道哪一個正在嘗試觸發。 – ader 2013-02-19 11:20:01
日誌在模擬器中運行,但不在設備上運行。我創建了全新的項目並且在那裏工作得很好,但是當我複製了舊的故事板內容和類時,問題重新出現.. !! – tGilani 2013-02-19 11:29:30