• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
-[NSWindow makeFirstResponder:] error when NSDrawer is involved
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[NSWindow makeFirstResponder:] error when NSDrawer is involved


  • Subject: -[NSWindow makeFirstResponder:] error when NSDrawer is involved
  • From: Bill Cheeseman <email@hidden>
  • Date: Fri, 24 Mar 2017 14:04:30 -0400

The principal view in my application's main window is a browser view. I want to make the browser view the main window's first responder.

My application also has a drawer associated with the main window. The first time -[NSWindow makeFirstResponder:] is called on the main window to make its browser view the first responder, I get this error message: "Setting <NSBrowser...> as the first responder for window <NSDrawerWindow...>, but it is in a different window.... This would eventually crash when the view is freed. The first responder will be set to nil." All subsequent calls to -makeFirstResponder: work correctly.

The error message is wrong when it says I am trying to set NSBrowser as the first responder for the drawer's hidden parent window. I have verified a dozen different ways that I am correctly calling -makeFirstResponder: on the main window -- by logging the main window's memory address and comparing it with the actual main window address, for example.

The error appears no matter where or how I call -makeFirstResponder. I have tried calling it in various places in my code, and by connecting the initialFirstResponder outlet to the main window in the nib file instead of calling -makeFirstResponder, and even by calling [[browser window] makeFirstResponder:].

The error appears no matter which view in the main window I try to make its first responder, such as a pop-up menu button. In other words, it isn't the choice of an NSBrowser as first responder that is causing the problem.

This error message first started appearing in macOS Sierra 10.12.0, and it is still appearing in 10.12.3. I suspect it is a bug in Sierra. When I examine the object code, I see that -makeFirstResponder: does in fact include some commands relating to drawers. I don't know why it does, but I suppose it might be making some inappropriate assumptions about my intent.

Fortunately, the error does not affect my application's functionality, presumably because setting the first responder of the drawer window to nil is not a problem. But I would like to get to the bottom of this.

Has anybody else encountered this issue? Any suggestions?

--

Bill Cheeseman - email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: -[NSWindow makeFirstResponder:] error when NSDrawer is involved
      • From: kata <email@hidden>
    • Re: -[NSWindow makeFirstResponder:] error when NSDrawer is involved
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: How do I set a NSTextView's font in Interface Builder?
  • Next by Date: Re: Is there a way to access other controller square's other icons programmatically?
  • Previous by thread: Re: Is there a way to access other controller square's other icons programmatically?
  • Next by thread: Re: -[NSWindow makeFirstResponder:] error when NSDrawer is involved
  • Index(es):
    • Date
    • Thread