I have modal window. In its controller I do this:
[[NSFontManager sharedFontManager] orderFrontFontPanel:self];
and it works fine. Font manager calls changeFont: method in my controller.
But if I write this code instead:
[[NSFontManager sharedFontManager] setTarget:self];
[[NSFontManager sharedFontManager] setAction:@selector(qwe:)];
[[NSFontManager sharedFontManager] orderFrontFontPanel:self];
it doesn’t work. When I select font in font panel it does not invoked qwe: method.
The reason is that window is modal (when I show the window without modal session all works fine). The question is why target-action variant does not work for modal window?
Thanks for help.
I see this, too. Setting the target and the action does not result in the action method being called.
What did work is this: (1) set the delegate, not the target, (2) name the method changeFont, and (3) do not set the action: