ITeye博客

使用push在两个tableview或者tableviewcell切换

夜鸣猪 · 2013-03-27 10:41 · 编程语言 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。