分類  >  編程 >

應用push在兩個tableview或者tableviewcell切換

tags:    時間:2013-12-23 13:15:20
使用push在兩個tableview或者tableviewcell切換
push segue between the view controllers

總之,要把第一個view加NavigationController

方便的可以這樣
Editor > Embed In > Navigation Controller


也可以:

引用
NavigationController -> UIViewController (has PageControl, hold multiple pages, horizontally scrollable) -> UITableViewController (represents one list of news for one category), and when user clicks on a single news, gets DetailsViewController (instance of UIViewController).


  if ([[segue identifier] isEqualToString:@"ShowTelegrafDetails"]){     TelegrafDetailsViewController *details = (TelegrafDetailsViewController*)segue.destinationViewController;      NSIndexPath *myIndexPath = [self.tableView indexPathForSelectedRow];           if([self isItPad])         details.linkFromTableView = [[otherNews objectAtIndex:myIndexPath.row] link];     else         details.linkFromTableView = [[[myViewController.itemMatrix objectAtIndex:[self calculateCurrentPage]] objectAtIndex:myIndexPath.row] link];      NSLog(@"%@",segue.sourceViewController);     NSLog(@"%@",segue.destinationViewController);      [self.myViewController.navigationController pushViewController:details animated:YES];     } 

推薦閱讀文章

Bookmark the permalink ,來源:互聯網