I have an NSButton btnOne and when the user clicks on the button, I want to simulate a click on another button btnTwo. btnTwo has an action which displays a message when clicked.
- (IBAction)btnOneClicked:(id)sender
{
[btnTwo performClick:self];
}
- (IBAction)btnTwoClicked:(id)sender
{
NSLog(@"btnTwo clicked");
}
When I run the program and click on btnOne, the performClick does not seem to simulate the click on btnTwo as no message is displayed.
I've also tried overriding the performClick() of btnTwo in an NSButton subclass to display the message.
-(void)performClick:(id)sender
{
NSLog(@"performClick");
}
This is also not happening. The message is not getting displayed.
What am I doing wrong?
Thanks.
I used in my on going project. And it worked for me.