// My Button code
UIButton *ticketButtonObj=[[ticketButton alloc]initWithFrame:CGRectMake(0.0f, 115.0f, 500.0f, 40.0f) ;
int col=10;
[ticketButtonObj addTarget:self action:@selector(ShowNumber:) forControlEvents:UIControlEventTouchUpInside];
[self.window addSubview:ticketButtonObj];
// ...
- (void) ShowNumber:(id)sender{
// here i want to get the Value of Col
}
In the above code when I press the button, I want to print the value of col variable in the ShowNumber
method. How can I do this?