Possible Duplicate:
connect button to TableViewController in xcode
How can I connect my button to another view controller class programmatically thanks in advance , I need the code I 'm really beginner thanks, here is my button code: my vie controller class name is year.m
-(void) year:(id)sender{
NSLog(@"Year button clicked");
}
Edit:
here is code for my programmatically button
UIBarButtonItem *yearButton= [[UIBarButtonItem alloc] initWithTitle:@"Year" style:UIBarButtonItemStyleBordered
target:self action:@selector(year:)];