So, for my project I needed to have some custom windows, which I created by subclassing NSWindow. Those also have their own Titlebar Views that display some controls, of of them being the regular clos开发者_如何学编程e button, hooked up like this:
[closeButton setTarget:[self window]];
[closeButton setAction:@selector(close)];
Now this works all perfectly fine, except for windows in which I have a WebView. Whenever I load up any Website in the given WebView, the close Button doesn't do anything anymore (before it works fine as well)
I have absolutely no idea, why this is happening, any kind of pointers would help a lot
Could the webview be replacing the target/action, or providing a delegate method that denies the close action?
Why don't you set some breakpoints to check the target/action or insert some tracing to print out what they are set to when the web windows are open?
精彩评论