In Apple Cocoa programing, the first responder is the first object in a chain of NSResponder subclasses to be called upon receiving an even such as keypress, mouseclick, etc.
Questions tagged [first-responder]
409 questions
4
votes
1 answer
Setting nextKeyView in IB; key view order is different when the app is run
I have a window full of text fields and buttons and I want to set its key view order in a particular way.
So, I set the initialFirstResponder to the first text field and correctly set the nextKeyView one by one for each control.
This has NO effect…

Prooshani
- 534
- 7
- 20
4
votes
1 answer
Disable WKWebView "funk" sound on keydown but allow typing input fields
I have a WKWebView in my App which contains input elements and textareas. Also it supports some key events, let's say A B C. When I press these key without focusing an input element I can hear the funk system sound of macOS – the WebApp also…

Kevin Lieser
- 951
- 1
- 9
- 25
4
votes
2 answers
NSCollectionView won't accept key events
I have a window with 3 NSTableViews and 1 NSCollectionView. The collectionview displays images. I want to be able to select one of the images and delete it using the keyboard delete key, but I can't get the collectionview to become first…

Dave Thompson
- 55
- 9
4
votes
1 answer
Where to call becomeFirstResponder(), at ViewDidAppear or ViewWillAppear?
What I want:
A textField and a textLabel is included in the tableView. When the tableView is present the textField will be the firstResponder and brings out the keyboard.
Problems I have:
the App is only shows the keyboard if the…

SLN
- 4,772
- 2
- 38
- 79
4
votes
1 answer
Removing a UIView
So I have a view controller called MainViewController with a button which when I press this code is called:
NewViewController *newViewController;
newViewController = [[NewViewController alloc] initWithNibName:@"NewView"…

ingh.am
- 25,981
- 43
- 130
- 177
4
votes
1 answer
iOS: How to forward touch events from subview to superview?
I have the following setup in my iPhone project (a UIButton that has a UIView as sub-view):
- UIButton // super-view <-------|
|
|_ UIView // sub-view ________|
I have connected an…

salocinx
- 3,715
- 8
- 61
- 110
4
votes
2 answers
Determine if responder chain will handle an action
The responder chain is cool.
Particularly, being able to send custom actions to the first responder that will bubble up to anyone else that might be interested: [[UIApplication sharedApplication] sendAction: @selector(commandToSend) to: nil from:…

Benjohn
- 13,228
- 9
- 65
- 127
4
votes
2 answers
keyDown works but i get beeps
I just got my keydown method to work. But i get system beep everytime i press key. i have no idea whats wrong. Googled for hours and all people say is that if you have your keyDown method you should also implement the acceptsFirstResponder. did that…

Oscar
- 375
- 3
- 15
4
votes
0 answers
Visualize first responder?
Is there some kind of AppKit/NSDocument/NSApplication debugging option, debugging flag or other third-party extension to visualize the current firstResponder for any given NSWindow instance in the current application?
We're building a single-window…

ATV
- 4,116
- 3
- 23
- 42
4
votes
5 answers
How to make UITextField become firstresponder using its tag field
I have several UITextfields, I am trying to set the first responder to be the first UITextField which its tag should equal 0.
This is how I am trying to achieve this in code
[[self.cutField viewWithTag:0] becomeFirstResponder];
But the problem…

HurkNburkS
- 5,492
- 19
- 100
- 183
4
votes
2 answers
Responder actions and responder chain
I am relatively new to IPhone coding, although I have reached the point of working on a genuine (hopefully) saleable app.
But one thing that is still mysterious is the responder chain. All the books give passing reference to it, but I have not…

John R Doner
- 2,242
- 8
- 30
- 36
4
votes
3 answers
Forward a UIGestureRecognizer from one view controller to another view controller
I'm adding a UIGestureRecognizer to one of my view controllers view.
My desired behaviour is when this gesture is recognised to dismiss the gestures view controller and forward it to another view controller. (the view controller I want to forward…

Devfly
- 2,495
- 5
- 38
- 56
4
votes
2 answers
UIButton doesn't dispatch touch event after uitextview becomes first responder
I have an UITextView that should become the first responder (display the keyboard) when the controller loads. The only thing is, that I have 'inflated' two UIView which each contain an UIButton. The touch events on these buttons do work when the…

Terrabythia
- 2,031
- 3
- 19
- 29
4
votes
1 answer
Silence Cocoa error beep
I have a Cocoa application that captures keypresses through a custom view in the view hierarchy. This view implements the keyUp and keyDown methods, and the keypresses are received. Even so, Cocoa still insists on playing the system error sound/ding…

Linuxios
- 34,849
- 13
- 91
- 116
4
votes
2 answers
Subclass a UITextField and detect when it becomes or resigns first responder
I subclassed a UITextField and wish to get a method called when it becomes first responder or resigns first responder. How can I achieve this?

Ben Lu
- 2,982
- 4
- 31
- 54