I want to pass the URL through the action of the button, because I have 10 buttons that are created using the code dynamically and when clicked, then for each corresponding button a specific URL is assigned. Here is my code
NSString *linkUrl = [NSString stringWithFormat:@"%@",[AllrecordG objectForKey:@"Link"]];
[leftLabelG addTarget:self action:@selector(clickMe:linkUrl:) forControlEvents:UIControlEventTouchUpInside];
-(void)clickMe:(UIButton *)sender{
}
But here I get a warning like "unused linkUrl variable".
I studied various articles, but someone said that passing the linke argument is not possible. Anyone can tell me how I can pass the URL for each button action, as well as how to get these values. in the definition of clickMe.
Thanks in advance.
source
share