title: how to push a view to another view
body: <p>How can I connect my button to another view controller class programmatically</p>
  
  <p>here is code for my programmatically button</p>
  
  <pre><code>UIBarButtonItem *yearButton= [[UIBarButtonItem alloc] initWithTitle:@"Year" style:UIBarButtonItemStyleBordered    
   target:self action:@selector(year:)];
  
  
  -(void) year:(id)sender{
      NSLog(@"Year button clicked");
  
      //I don't know what should I write here to connect my button to UIViewController**
      //when I added this line my process is terminated** 
  
      [self performSegueWithIdentifier:@"YearView" sender:self]; 
   }
  
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
      if ([segue.identifier isEqualToString: @"YearView"]){
         [segue.destinationViewController setTitle:@"YearView"];
      }
  }
  </code></pre>
  
  <p>Here you can see my view in storyboard:
  ![enter image description here][1]</p>
  
  <p><strong>Edit:</strong>
  *<em>My process is Terminated when I used this method</em>*</p>
  
  <pre><code>-(void)year:(id)sender{
  
  // [self performSegueWithIdentifier:@"YearView" sender:self]; 
  NSLog(@"Year button clicked");
  YearView *yearVC = [[YearView alloc] initWithNibName:@"YearView" bundle:nil];
  
  [[self navigationController] pushViewController:yearVC animated:YES];   // [yearVC release];
  
  }
  </code></pre>