问题
I have an IBAction of when the button is clicked to change my view. How can I handle multiple clicks for example if I click the button a second time to cause another action?
Or do I need to delete the button after it has been clicked and then create a new one in its place? If so how do I handle the click event?
回答1:
You can check the clickCount
of the mouseDown event:
if ([event clickCount] > 1)
{
// ... do double-click action
}
else
{
// ... do single-click action
}
来源:https://stackoverflow.com/questions/8997522/nsbutton-multiple-clicks