0

I have this line calling -makeFirstResponder:

[self.window makeFirstResponder:libraryViewController.imageBrowser];

imageBrowser is of type CaptureBrowserView, a subclass of IKImageBrowserView, which is a subclass of NSView which is a subclass of NSResponder

@property (weak) IBOutlet CaptureBrowserView *imageBrowser;
@interface CaptureBrowserView : IKImageBrowserView
@interface IKImageBrowserView : NSView <NSDraggingSource> {
@interface NSView : NSResponder <NSAnimatablePropertyContainer, NSUserInterfaceItemIdentification, NSDraggingDestination, NSAppearanceCustomization, NSAccessibilityElement, NSAccessibility>

But I get this error:

Incompatible pointer types sending 'CaptureBrowserView *' to parameter of type 'NSResponder *'

Am I overlooking something obvious? Or is an IKImageBrowserView, for some reason, specifically unable to become the first responder?

A O
  • 5,516
  • 3
  • 33
  • 68

1 Answers1

1

Did you actually #import "CaptureBrowserView.h" in the file that does makeFirstResponder:? If the compiler has only seen a forward declaration of CaptureBrowserView at that point, it doesn't know that it's an NSResponder.

rob mayoff
  • 375,296
  • 67
  • 796
  • 848