Give String To Tag vallue for Button
i wanted to give the String value to Button tag for unique identities.
i tried this code won't work
NSString *A;
NSString * B;
NSString * C;
NSString * D;
firstOptionABtn.tag=[A integerValue];
secondOptonBbtn.tag=[B integerValue];
thirdOptionCbtn.tag=[C integerValue];
fourthOptionDbtn.tag=[D integerValue];
}
- (IBAction)BtnClicked:(UIButton *)sender
{
NSLog(@"%ld",(long)sender.tag);
}
i done like this way but it wll print 0 every time where may i wrong.
please help me out this.
thanks in advance.
No comments:
Post a Comment