title: Invoking push segue programmatically and prepareforsegue method
body: <p>I'm invoking <code>push segue</code> programmatically as below</p>
  
  <pre><code>    UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
      UIViewController *vc = [mainStoryBoard instantiateViewControllerWithIdentifier:@"addToCartViewContollerForItem"];
      [self.navigationController pushViewController: vc animated:YES];
  </code></pre>
  
  <p>but my problem is I want to send some info with this segue to the destination viewcontroller. But the method <code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender</code> is not getting fired at all.</p>
  
  <p>this is how the prepareforsegue method </p>
  
  <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      // Get the new view controller using [segue destinationViewController].
      // Pass the selected object to the new view controller.
      NSLog(@"segue from deals screen");
      //addToCartViewContollerForItem
      if([[segue identifier] isEqualToString:@"addToCartSegue"]){
          NSIndexPath *selectedRow = [[self tableView] indexPathForSelectedRow];
  
          Item *currentItem = [[Item alloc]init];
          currentItem = [itemList objectAtIndex:[selectedRow row]];
  
          RESTAddToCartViewController *vc = [segue destinationViewController];
          [vc setCurrentItem:currentItem];
      }
  }
  </code></pre>
  
  <p>What am I missing here? </p>