Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Pass variable to a detail view controller using a table in UIViewController (not UITableViewController!!)
  2. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  3.  
  4.     if ([[segue identifier] isEqualToString:@"toDetailView"]) {
  5.  
  6.         NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow];
  7.         DetailViewController *detailViewController = [segue destinationViewController];
  8.         detailViewController.play = [dataController objectInListAtIndex:selectedRowIndex.row];
  9.     }
  10. }
  11.        
  12. @property (nonatomic, assign) IBOutlet UITableView *tableView;