The tag value is an Integer:
UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:addressField forState:UIControlStateNormal];
[bu
You can do that as bellow with the help of feature objc_runtime
#import
static char kButtonAssociatedKey;
NSString *aStrKey = [NSString stringWithFormat:@"Any Key"];
UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:addressField forState:UIControlStateNormal];
[button addTarget:self action:@selector(pickTheQuiz:) forControlEvents:UIControlEventTouchUpInside];
button.tag=1;
objc_setAssociatedObject(button,
&kButtonAssociatedKey,
aStrKey,
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-(void)pickTheQuiz:(id)sender
{
NSString *aStrKey = objc_getAssociatedObject(sender, &kButtonAssociatedKey);
objc_removeAssociatedObjects(sender);
NSLog(@"%@", aStrKey);
}