// 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
}
В приведенном выше коде, когда я нажимаю кнопку, я хочу напечатать значение переменной col в методе ShowNumber
. Как я могу это сделать?