使用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];
}