2013-03-12 47 views
1

我在左側滑動條上使用JTRevealSidebar V2和UITableViewJTRevealSidebar推送到ViewController

我不知道如何通過發送消息推送到其他ViewController。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    if (self.sidebarDelegate) { 
     NSString *text = [self.leftList objectAtIndex:indexPath.row]; 
     if ([text isEqual:@"Warenkorb"]) { 
      NSLog(@"Ist warenkorb"); 
      // How to push/create/bring2top view of msCartViewController Identified by "Cart"? 
      // NSLog works 
     } 
    } 
} 

這怎麼辦?

回答

1

在您的rootviewcontroller中,您將分配一個新的UIViewController,然後將其推到UINavigation堆棧上。

例如:

UIViewController *myViewController = [[UIViewController alloc] init];

myViewController.title = @"My First View";

myViewController.view.backgroundColor = [UIColor redColor];

//to push the UIView.

[self.navigationController pushViewController:myViewController animated:YES];

記住要做到這一點在你的根視圖控制器! 希望這有助於。

相關問題