Lets say I have 10 buttons. For each button i want to pass some text... e.g. Button 1, My New Button 2, etc....
What I want to do is print this text in NSLog.
Hence I created one method and passed this to button. But I am not getting how can I pass data into it...
[myButton addTarget:self action:@selector(btnSelected:) forControlEvents:UIControlEventTouchUpInside];
-(IBAction)btnSelected:(id)sender {
NSLog(@"btnSelected data is %@", sender);
// I want to print some text for respective button here...
}
But I am not getting... any idea how to get this done?