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
10
votes
3 answers
Is there a robust way to detect first responder changes in subviews?
I'm building a custom view that contains several other subviews (NSTextField, WebView,...). I'd like to have my custom view draw a different border when one of the subviews is the first responder, and act as a single item that can be acted upon with…

Joseph North
- 501
- 4
- 13
10
votes
2 answers
How to Get Current First Responder from Window Controller in Cocoa?
I would like to find the first responder view in a window. To do this, I would like to implement a category like this:
@implementation NSView (ViewExtensions)
- (NSView *)findFirstResponder
{
if ([self isFirstResponder]) {
…

A A
- 147
- 1
- 2
- 8
9
votes
5 answers
Find View that is the firstresponder
I would like to get the view that is the first responder, currently I have a UITableView that contains UITextFields, using a method:
-(UIView*) findFirstResponder
{
}
I would like to be able to get the view that is the firstResponder and then do…

Armand
- 9,847
- 9
- 42
- 75
9
votes
3 answers
Programmatically determine order in which UIView items should be read by VoiceOver
I am making my iPhone app accessible. VoiceOver is pretty impressive. When a user uses VoiceOver, it automatically reads off the items on the screen and allows the user to double-tap anywhere on the screen to select that item. However, I want…

Jason
- 14,517
- 25
- 92
- 153
9
votes
5 answers
Keyboard Animation Issues When Calling becomeFirstResponder within a Modal View Controller
I've been having some issues with calling -becomeFirstResponder on a UITextField contained with a view controller that is presented modally. I call this method in the modal view controller's -viewDidLoad method so that the keyboard is immediately…

CIFilter
- 8,647
- 4
- 46
- 66
9
votes
3 answers
iPhone UITextView which is disabled becomes first responder when re-enabled
I have an application which has some text views on one of the controllers.
When the application is processing these text views are disabled and have their user interaction disabled.
The problem is that when the text views are re-enabled they respond…

Craig Warren
- 1,655
- 4
- 23
- 38
9
votes
2 answers
UITextField losing firstResponder after view appears
I have a UIPageViewController. One page has a single button, and the other page has a UITextField with a button. When the page scrolls to the view with the field, I'd like it to becomeFirstResponder and open the keyboard. Here's what happens:
I…

dclowd9901
- 6,756
- 9
- 44
- 63
8
votes
2 answers
Showing UIMenuController loses keyboard
I'm making an iphone app similar to the Messages app that comes on the phone. I just set up the ability to copy messages via a UIMenuController, but if the keyboard is showing and someone tries to copy a message, the keyboard goes away (presumably…

Stephen
- 741
- 8
- 18
8
votes
1 answer
Understanding system logic for first responder
I'm confused about severals first responder points:
If I call - becomeFirstResponder, does system call – canBecomeFirstResponder first? Why?
Why are there both - becomeFirstResponder and – canBecomeFirstResponder? In what situations they can return…

user500
- 4,519
- 6
- 43
- 56
8
votes
3 answers
How to make embedded view controller part of the responder chain?
I am developing a Mac app using storyboards. I have a window that presents an NSViewController as its contents, which contains a "container view controller" that embeds an NSSplitViewController.
The expected behaviour is for the…

Abstract-Sky
- 309
- 1
- 12
8
votes
4 answers
How to detect when NSTextField has the focus or is it's content selected cocoa
I have a NSTextField inside of a NSTableCellView, and I want an event which informs me when my NSTextField has got the focus for disabling several buttons, I found this method:
-(void)controlTextDidBeginEditing:(NSNotification *)obj{
NSTextField…

Jesus
- 8,456
- 4
- 28
- 40
7
votes
4 answers
hitTest fires when UIKeyboard is tapped
I'm trying to fix a bug that involves UIView hitTest:withEvent: being called on my view when the touches are on the UIKeyboard, but only after the app has been in the background.
It was occurring in my app with a complex view hierarchy so I…

brianpartridge
- 763
- 8
- 19
7
votes
2 answers
Why does setting initialFirstResponder have no effect?
I have a simple form (NSWindow) with 3 text fields. NSWindow's initialFirstResponder is 'pointing' to the first field (NSTextField). All three text fields are circularly linked to each other via nextKeyView.
Problem that I have is that when I start…

rytis
- 2,649
- 22
- 27
7
votes
4 answers
Dismissing the First Responder/Keyboard with multiple Textfields
Like seriously after going through this...
Easy way to dismiss keyboard?
... I have multiple TextFields and a few TextViews. Is there not a way to a have a batch or group Dismiss First Responder for all text fields? Will I need to make method for…

xTHENKx
- 160
- 1
- 8
7
votes
2 answers
Best way to wire up NSMenuItems from Interface Builder?
So I've spent some time checking out CocoaDev, reading the Cocoa docs on NSMenuItems, and doing some tests in Interface Builder.
In my application I have an application menu ([NSApp mainMenu]) designed in Interface Builder. I see three potential…

Chris Hill
- 1,914
- 1
- 16
- 24