문제

I have added a NSPathControl to a View in my application. In awakeFromNib I sets the double-click action:-

[currentPath setDoubleAction:@selector(dClickPath:)];

Unfortunately, double-click on the PathControl does not work, although I had first tested this a simple stand alone test application.

I suspect that there may be some interaction with other elements. In particular I have a NSSplitView which contains a NSOutlineView and a NSTableView, both of which have Double Click Target bindings to separate selectors in the controller.

I don't see why these should affect the NSPathControl.

If I connect the NSPathControl selector to dClickPath: then Click on the PathControl works.

도움이 되었습니까?

해결책

Are you setting the target? When you connect a control in IB, that sets the target and the action. If you don't do that in IB, then setting the double-click action in code is not enough. You also have to set the target.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top