title: executing the "prepare for segue" method in a split view
body: <p>I have a universal application that is very basic. It is a master detail. When I segue from the master to the detail, I set the text in a label, and set the title of the destination view controller with an NSString. This works fine on iPhone, but on iPad, it doesn't set the title or the label. Here is the code I am using to set everything:</p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if ([[segue identifier] isEqualToString:@"showDetail"]) {
          NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
          NSString *object = dailyGramsNumbers[indexPath.row];
          NSString *object1 = dailyGramsBody [indexPath.row];
          [[segue destinationViewController] setDetailItem:object1];
          [[segue destinationViewController] setTitle:object];
  
      }
  }
  </code></pre>
  
  <p>thanks for any help!</p>
  
  <p>here is the code I am using now (in addition to the above code):</p>
  
  <pre><code>- (void)tableView:
  
      (UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
      {
          if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
              NSString *object = dailyGramsNumbers[indexPath.row];
              [self.splitViewController.viewControllers[1] setTitle:object];
  
              self.detailViewController.detailItem = object;
          }
      }
  </code></pre>