2009-11-03 16 views
0

我正在使用登錄視圖進行應用程序。這只是簡單的UIViewController與一個UIbutton上它。我有另一個UINavigatioController具有UITableView作爲RootViewContoller與許多表對象在每一行。問題是:如何從loginview切換到tableview.Also應該沒有navigationviewler上loginview ..and如果這是不可能的,那麼應該有辦法在loginview上隱藏它。 對於loginview我有login.xib,我在應用程序startup.but加載它在登錄視圖上單擊UIButton它應該去TableViewController NavigationController.Is它可能加載TableviewController與NavigationController從單獨的nib.if它是那麼我將如何設置代表和觀點在那個筆尖上? 我m不安地得到它的答覆..我的要求2所有的程序員去看看它..雖然它看起來有點容易,但不是.. ..懸掛它超過2周..plz幫助這個可憐的傢伙!如何切換一個視圖上的一個UIButton,與導航控制器使用該UIButton的一個?

+0

請格式化正確 – NDM 2009-11-03 12:43:09

回答

1
-(IBAction)goToView2:(id)sender 
{ 
MyTableViewController *tableView = [[MyTableViewController alloc] initWithNibName:@"MyTableViewController" bundle:nil]; 
UINavigationController *mySocondView =[[UINavigationController alloc] 
           initWithRootViewController:tableView]; 
[self presentModalViewController: mySocondView animated:YES]; 
} 
1

首先你應該設置委託給你的導航控制器。如果你知道如何設置代表。使用此代碼到另一個觀點與UITableView的導航控制器:

-(IBAction)goToView2:(id)sender 
{ 

    UINavigationController *mySocondView =[[UINavigationController alloc] 
            initWithRootViewController:[[MyTableViewController alloc] 
                   initWithNibName:@"MyTableViewController" bundle:nil]]; 

    [self presentModalViewController: mySocondView animated:YES]; 
} 
您導航視圖

ü可以繼續你的項目:)

+0

感謝Momeks,它worked.now我可以從我離開的地方繼續。 – 2010-01-07 13:16:19

相關問題