2012-03-12 72 views
0

我想知道導航從一個頁面到另一個頁面的onclick。我 嘗試的方法 [self.navigationController pushViewController:自 .objectNewlist 動畫:是]; 但它示出了錯誤 不相容指針類型發送「newlistplist *」到類型的參數「的UIViewController *」導航到另一個頁面點擊數

我的主類文件是的UIViewController 和所述第二類的一個子類的UITableViewController 的子類可以任何有人幫我解決這個問題嗎?

回答

0

您可以使用

UIViewController *yourViewController = [[YourViewControllerClass alloc] initWithNibName:@"<name of xib>" bundle:nil]; 
[self presentModalViewController:yourViewController animated:YES]; 
[yourViewController release]; 

在情況下,新觀點也是以編程方式創建,你可以做,在YourViewControllerClass的viewDidLoad方法,改變初始化

UIViewController *yourViewController = [[YourViewControllerClass alloc] init]; 

在YourViewController當您希望回到以前的某個按鈕動作視圖時,您可以使用

[self dismissModalViewControllerAnimated:YES]; 

,你可以做另一方法是

UIViewController *yourViewController = [[YourViewControllerClass alloc] init]; 
[self addSubview:[yourViewController view]]; 

和刪除視圖可以使用

[self.view removeFromSuperview]; 
+0

感謝您的答覆。我想知道更多的事情。是plist存儲數據的好方法嗎? – ashwin19 2012-03-12 06:22:47

+0

SQLlite和核心數據是不錯的選擇.. – 2012-03-12 06:28:44

+0

你有問題嗎? – 2012-03-12 06:46:45

0
-(void)onClickButton 
{ 
    ViewControllerClass *objViewControllerClass = [ViewControllerClass alloc] init] ; 
    [self presentModalViewController:objViewControllerClass animated:YES]; 
    [objViewControllerClass release]; 
} 

objViewControllerClass(另一個類的對象),

相關問題