I'm trying to call an ibaction method when an NSButton is clicked down, but I can't figure out how to get do to that instead of having it called when clicked up.

有帮助吗?

解决方案

[yourButton sendActionOn:NSLeftMouseDownMask];

其他提示

[btn setAction:@selector(Method:)];

[btn setTarget:objectThatRespondsToMethod];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top