0

Please help me to figure this out. I am having two tab bar items in a tab bar application. First tab bar view with UITableView and second tab bar view with a label. I trying to pass table cell value to second tab view, by clicking a table cell and showing the value in the label of second tab view. The tab bar controller at the bottoms should be still visible. The main thing is I want the respective tab should be selected. I am using Xcode 4.3.2. This is something, will look like, I want to open a tab bar view from another tab bar view with a click of table cell. Thanks

1 Answers1

0

Drag a line in the story boardfrom the tableviewcell (the cell!) to your view.

In

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

You get the destination controller like so:

 if ([[segue identifier] isEqualToString:@"my_vc_1"]) {        
        MyViewController *detailViewController = [segue destinationViewController];
        // here you can either reference the outlet directly
        detailViewController.my_label.text = @"my value";
 }

Don't forget to include your "MyViewController.h" on the top.

Check out:

http://developer.apple.com/library/ios/#DOCUMENTATION/General/Conceptual/iCloud101/ImplementingtheDetailViewController/ImplementingtheDetailViewController.html

Roger
  • 7,535
  • 5
  • 41
  • 63