Questions tagged [nsresponder]

NSResponder is a class used in Mac Development. NSResponder is an abstract class that forms the basis of event and command processing in the Application Kit. The core classes—NSApplication, NSWindow, and NSView—inherit from NSResponder, as must any class that handles events. The responder model is built around three components: event messages, action messages, and the responder chain.

103 questions
53
votes
2 answers

Unlocking Focus on wrong view ((null)) under OS X 10.7.2

I have a Cocoa app that has an NSWindowController controlling an NSWindow with an NSComboBox in it. Nothing special, and it worked fine until upgrading to OS X 10.7.2. Now I get the following exception, which occurs only once, when the window…
alexantd
  • 3,454
  • 3
  • 24
  • 40
26
votes
5 answers

UIScrollView prevents touchesBegan, touchesMoved, touchesEnded on view controller

I am handling touches for a couple of my UI components in my view controller (custom subclass of UIViewController). It has methods touchesBegan:withEvent:, touchesMoved:withEvent:, and touchesEnded:withEvent:. It was working fine. Then I added a…
morningstar
  • 8,345
  • 5
  • 26
  • 39
22
votes
6 answers

How to inspect the responder chain?

I'm doing some crazy multiple documents inside a single window stuff with the document-based architecture and I'm 95% done. I have this two-tier document architecture, where a parent document opens and configures the window, providing a list of…
d11wtq
  • 33,252
  • 14
  • 115
  • 186
18
votes
7 answers

Catching double click in Cocoa OSX

NSResponder seems to have no mouse double click event. Is there an easy way to catch a double click?
Mike2012
  • 7,159
  • 13
  • 76
  • 131
13
votes
4 answers

How to add NSViewController to a responder chain?

I'm having hard time understanding and finding info about how to make NSViewController accept key and mouse events. I read somewhere that in order to register these events in NSViewController it should be added to a responder chain, but I can't find…
Eugene Gordin
  • 3,735
  • 1
  • 35
  • 71
13
votes
1 answer

NSResponder not receiving keyUp event when Cmd ⌘ key held down

I'm using a custom subclass of NSView and receiving keyboard events through the keyDown/keyUp methods, everything works fine except when the "Cmd ⌘" key is pressed, keyDown events are fired as normal but the keyUp event never comes. In our case we…
Jez Cooke
  • 131
  • 4
9
votes
0 answers

validateMenuItem on NSViewController

Is it possible to have validateMenuItem work with NSViewControllers? The docs say NSViewController is a subclass of NSResponder so I would think it would participate in the responder chain, but I have never been able to get it to work. I can make…
jsd
  • 7,565
  • 5
  • 24
  • 42
8
votes
1 answer

NSToolbarItem validation in relevant controller

I have an NSToolbarItem with an NSButton as its view and an NSMenuItem in the main menu. Both have the same action, which is sent to the first responder, not to a particular target. That method is ultimately implemented in a subclass of…
Eitot
  • 166
  • 1
  • 8
8
votes
1 answer

How to deal with first responder and a NSPopover

I’m trying to replicate the behaviour of the search field in iTunes, for looking up stock symbols and names. Specifically, as you start typing in the search field a popover appears with the filtered items. For the most part I have this working…
Cory
  • 2,212
  • 17
  • 30
8
votes
2 answers

How do I route menu actions to an NSViewController inside a window?

I have a menu item inside the main app menu and I’d like to route its action to a view controller (NSViewController). The interface hierarchy looks like this: There’s a main app window controller by an NSWindowController. Inside the window there’s a…
zoul
  • 96,282
  • 41
  • 242
  • 342
6
votes
1 answer

Allow views in childWindow to become key without losing focus on parentWindow

I added a childWindow of a custom subclass of NSWindow to a parentWindow (also a custom subclass of NSWindow). The childWindow has the NSBorderlessWindowMask and canBecomeKeyWindow: is overridden to return YES and canBecomeMainWindow: to return…
tungsten
  • 333
  • 3
  • 12
6
votes
2 answers

Unwanted beep when a key is hit

I have a custom view that accepts key input, its inside a NSScrollView. I have set the acceptsFirstResponder to yes and it is accepting the keyDown successfully. But every time I hit a key, I hear a beep. I'm sure that there something else needed…
the Reverend
  • 11,251
  • 9
  • 58
  • 106
5
votes
2 answers

How to receive keyboard events for a NSView after exiting fullscreen mode?

I subclass an NSView and start full screen mode when the application finished launching. The view is available as the property fooView in the application delegate. // AppDelegate.m - (void)applicationDidFinishLaunching:(NSNotification*)notification…
JJD
  • 44,755
  • 49
  • 183
  • 309
5
votes
1 answer

Make NSView in NSPanel first responder without key window status

Is it possible to give an NSView inside an NSPanel first responder status without giving the NSPanel key window status (making the main application window resign key)? Thanks.
indragie
  • 17,634
  • 15
  • 89
  • 161
4
votes
3 answers

View interpretKeyEvents: but pass unwanted ones up the responder chain?

I'd really like my custom view to work with -moveLeft:, -deleteForward:, -selectAll:, etc., but I'd also like to pass any keys I didn't care about onward up the responder chain. Right now I'm overriding -keyDown: to call [self…
andyvn22
  • 14,453
  • 1
  • 46
  • 74
1
2 3 4 5 6 7