2012-10-18 84 views
2

Am使用此故事板概念開發iphone應用程序。iPhone故事板呈現模型視圖以編程方式

這裏我已經完成了使用這個故事板的初始視圖。

在這裏,我已經在用戶點擊這個按鈕編程方式在rootviewcontroller中創建了一個按鈕,我應該提出另一個視圖控制器讓我們說root2ViewController。我在下面的代碼中使用了當前的視圖,但它沒有顯示任何內容,並且它說像標識符未找到。任何解決方案和想法將不勝感激。

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" 
                bundle:[NSBundle mainBundle]]; 
UIViewController *root2ViewController = [storyboard instantiateViewControllerWithIdentifier:@"MyIdentifier"]; 
[root2ViewController setModalPresentationStyle:UIModalPresentationFullScreen]; 
[self presentViewController:root2ViewController animated:animation completion:nil]; 

回答

0

我找到了解決辦法在行動調用這個方法下面是沒有魔法。

[self performSegueWithIdentifier: @"FindMyClinic" sender: self]; 
1

在你故事情節,你需要設置你的故事板標識檢查窗口視圖控制器

+0

是的,我已經加入 – nik

相關問題