2015-07-10 66 views
0

我有嵌入在用戶輸入用戶ID一個UINavigationController登錄的UIViewController /密碼之後,點擊[註冊]按鈕工作看起來像這樣:navigationController popToRootViewControllerAnimated未在IOS 8

2-文本字段和一個UIButton,當用戶點擊該按鈕,我運行代碼:

-(void)btLoginTapped:(id)sender{ 
[doLogin]; 
NSLog(@"Login Successful.") 
[self.navigationController popToRootViewControllerAnimated:YES]; 
} 

現在,當我使用模擬器或與iOS 8 一個設備,我會看到日誌消息,但視圖控制器不會在那裏彈出,當我使用模擬器我出現問題/設備與iOS 7視圖將正常彈出到根目錄。 爲什麼不會 [self.navigationController popToRootViewControllerAnimated:YES] 在iOS 8+中工作,但它可以在iOS 7+中工作? 請注意,我已將Animated標誌更改爲NO,我也嘗試過: [self.navigationController popViewControllerAnimated:YES/NO]但仍然是同樣的問題?

任何輸入表示讚賞。謝謝。

+0

檢查我編輯的答案。 –

+0

我的問題是不與[navigationController popViewControllerAnimated:]它的工作原理,但只適用於設備或模擬器運行iOS 8之前。但是,如果我在設備或模擬器中運行iOS 8.4的popViewController視圖不會彈出?!有類似問題的人在那裏? – coder74309

回答

0

試試這個

[self dismissViewControllerAnimated:YES completion:nil]; 

,而不是popToRootViewControllerAnimated如果你可以把你的根視圖控制器,然後它會工作。 希望它有幫助。

+0

試過。它不僅工作,但iosSimulator iPhone4s(7.4)也停止工作。 – coder74309

相關問題