`

使用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];
    }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics