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
3
votes
0 answers
Questions about setting the First Responder in Xcode
I'm just reading Apples' developer document of Xcode (http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/InterfaceBuilder/InterfaceBuilder.html)
We know that the difference between the two event handling…

user1284864
- 31
- 1
3
votes
1 answer
NSTextField events and resigning first responder
I want to implement an NSTextField where when I click it, it selects all the text. (to give the user easy way to delete all current text)
when I finish editing it, either by pressing enter/tab or moving the mouse outside of it's rect, I will move …

Idan
- 5,717
- 10
- 47
- 84
3
votes
0 answers
How to NOT dismiss keyboard when switching between two first responder textfields in SwiftUI
So I have a SwiftUI gesture that causes a state change to switch between two different views. In each of these views, the central component is a TextField (in this case a CocoaTextField, which was imported with SwiftUIX (a GitHub module). Each text…

nickcoding2
- 142
- 1
- 8
- 34
3
votes
2 answers
Setting the inputAccessoryView of a UITextField to its superview
I have a UITableView with an Add cell... row and would like to have a keyboard pop up with a view above it like in the "Messages" application, where the user can type the name of the new cell.
I realize that there are several other ways to get user…

Julian Ceipek
- 525
- 3
- 13
3
votes
3 answers
Objective C: Can I set a subview to be firstResponder?
I have a situation whereby I am adding a view from another viewcontroller to an existing viewcontroller. For example:
//set up loading page
self.myLoadingPage = [[LoadingPageViewController alloc]init ];
self.myLoadingPage.view.frame =…

Zhen
- 12,361
- 38
- 122
- 199
3
votes
1 answer
Mac Catalyst textfield first responder
On Mac Catalyst my app feature with textfield becomeFirstResponder() doesn't work. I try to put this code in viewwillappear:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
…

alexsmith
- 199
- 2
- 10
3
votes
0 answers
TextField rejected resignFirstResponder when being removed from hierarchy
I'm trying to make a custom textfield/sendbutton view that overrides inputAccessoryView, but I'm having 2 problems I can't seem to solve:
When the custom view becomes the first responder, I get this warning twice:
CustomKeyboardProject[5958:3107074]…

Wilson Desimini
- 722
- 5
- 10
3
votes
0 answers
Scrolling NSTextView in OSX Today Widget with scrollwheel
I have the following view hierarchy in Today Widget app:
NSScrollView
NSClipView
NSTextView
When the text in NSTextView is bigger than it's size, I am able to scroll by highlighting text with a mouse, or by using arrow keys.
But when I try to…

Richard Topchii
- 7,075
- 8
- 48
- 115
3
votes
3 answers
UITextField resign first responder iOS4
I have a simple piece of code that works on every system except iOS4.
It's about resigning first responder for a UITextField. The text field is all wired up, and here's the code for the delegate:
- (BOOL)textFieldShouldReturn:(UITextField…

dusker
- 580
- 3
- 11
3
votes
2 answers
Why does my NSWindow only receive mouseOver events the first time?
I have an application where a borderless window is shown and hidden, using orderOut and orderFront. When it is visible, I want the it to become the key window when the mouse moves over it.
So far I've done this:
In awakeFromNib I have set its first…

DanieL
- 31
- 2
3
votes
1 answer
Forwarding a gesture to superview
So I have got this scenario:
-NavigationController
-PageViewController
-MapViewController
-UIView
-MKMapView (Full Screen)
-OtherViewController
So basically, I want it to switch pages (viewcontrollers) when catching the…

jonypz
- 1,515
- 1
- 20
- 35
3
votes
2 answers
Can't Call resignFirstResponder from textFieldDidBeginEditing ? (iPhone)
[myTextField becomeFirstResponder];
[myTextField resignFirstResonder];
When I do this -(BOOL)textFieldShouldReturn:(UITextField *)textField , it works. But when I use the same code inside -(void)textFieldDidBeginEditing:(UITextField *)textField ,…

Chris
- 5,485
- 15
- 68
- 130
3
votes
0 answers
Why does UITextField begin editing when view controller is popped off the navigation stack?
I have a single UINavigationController, with an arbitrary root view controller. Then, I push the following subclassed UITableViewController onto the nav stack:
@interface BugViewController : UITableViewController…

Emmett
- 14,035
- 12
- 56
- 81
3
votes
2 answers
"Fixed" Strange "unrecognized selector sent to instance" crash happens on iOS8 beta5
My app works fine on iOS7,but crashes on iOS8.
I've seen various question on this topic but never found a good solution for it.
I have an App that's using UITableViewController and UITableViewController has an SearchDisplayController instance call…

ylovesy
- 904
- 1
- 8
- 21
3
votes
1 answer
Need to click twice on NSTextField to become active
I have an NSTextField which is by default non editable and is first responder.
I would like to make the NSTextField editable/active as soon as I click on it.
I subclassed it and used the mousedown event:
- (void)mouseDown:(NSEvent *)theEvent
{
…

Laurent Crivello
- 3,809
- 6
- 45
- 89