Question

I've subclassed NSView (MyCustomView) and have added it to my NSWindow's Content View in InterfaceBuilder using the custom view object in MainMenu.xib.

I have since added code to accept Quick Look responses to MyCustomView.

After calling this:

[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil];

Which asks the Quick Look window to appear, apparently the QLPreviewPanel goes through the Responder chain looking for anything that responds to -(BOOL)acceptsPreviewPanelControl: in order to do what it needs to. MyCustomView doesn't seem to be responding, despite having the relevant methods for Quick Look to function, including the aforementioned.

I tried adding the following to my init method of MyCustomView but makes no difference:

[self acceptsFirstResponder];
[self becomeFirstResponder];

Any ideas what I am missing? I assume it's something to do with my xib setup?

Was it helpful?

Solution

Found out my issue. My NSView subclass did not implement the following:

- (BOOL)acceptsFirstResponder
{
    return YES;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top