Questions tagged [first-responder]

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.

409 questions
3
votes
1 answer

Which NSTextView is the First Responder?

I'm working on a Cocoa programming exercise, and I need to be able to determine which of two NSTextView objects is currently being edited. I think it's something to do with finding the first responder and checking to see if it's equal to one text…
Zev Eisenberg
  • 8,080
  • 5
  • 38
  • 82
3
votes
1 answer

NSTextField is first responder but I still must click inside the text box before typing

My ultimate goal is to have an NSTextField selected by default allowing the user to start typing without clicking on the text field first. I have a view controlled by a NSViewController. The view contains several text fields. The NSView and…
Ian K
  • 137
  • 1
  • 10
3
votes
0 answers

Using next and previous button with UITextField, problems with firstresponder

I am using a subclass of a scrollview that moves the keyboard out of the way. (TPKeyboardAvoidingScrollView) I think this is conflicting with my implementation of the next and previous buttons. I have built an inputaccessoryview I have a category…
hamobi
  • 7,940
  • 4
  • 35
  • 64
3
votes
1 answer

Present ViewController modally shows weird animation

I'm trying to create a simple modal view controller that lets you edit text using a text view. However, when I present the view controller modally, it slides in from the bottom left direction instead of just sliding in from the bottom. Here's a…
aloo
  • 5,331
  • 7
  • 55
  • 94
3
votes
2 answers

How to "transfer" first responder from one UIView to another?

I have a UIView subclass (CustomView for purposes of this question) that has its own handling of all touches events (Began, Moved, Ended, Cancelled). I also have a UIButton that is a sibling of CustomView that overlaps it. For example, my view…
Jason
  • 28,040
  • 10
  • 64
  • 64
3
votes
2 answers

Specify editing NSTextField inside NSPopover on appearance

I'm working on an app that presents an NSPopover containing a number of NSTextFields. While I can tab between these fields as I expect, the popover is selecting a particular text field to be in the editing state when it appears, and it's not the…
Tim
  • 59,527
  • 19
  • 156
  • 165
3
votes
1 answer

Which should be the first responder: my view or UIDatePicker?

I'm creating sibling of UITextField, but with UIDatePicker instead of a keyboard. I want multiple such controls to play nicely with each other and also standard UITextField (i.e. swap keyboard for date picker when my control is activated, and hide…
Kornel
  • 97,764
  • 37
  • 219
  • 309
3
votes
1 answer

Receiving RemoteControlEvents to First Tab when interacting in Second Tab in a TabBar Controlled iOS App

I am developing an iOS app with a tab bar controller. In the first tab, I placed an instance of AVQueuePlayer to start playing music from the web. I did all coding to allow play and pause events through remote control events. But I could able to…
3
votes
2 answers

Setting tab order for NSTextFields of an NSView

I am trying to set the tab order for NSTextFields on a given NSView. As far as I understand it I have to connect the NSTextFields with InterfaceBuilder by setting the nextKeyView outlet to the next NSTextField. I did this - and there is no effect.…
Joseph
  • 9,171
  • 8
  • 41
  • 67
2
votes
1 answer

Resizing view on becomeFirstResponder and resignFirstResponder - Cocoa (OS X)

I have a search field whose original width is small (because it looks better that way). However, when the user clicks on the search field, I want to make its width bigger by a certain amount. When the user clicks outside, I want to resize it to the…
Alex
  • 5,009
  • 3
  • 39
  • 73
2
votes
1 answer

Clean way to resign first responder of NSSearchField when done?

In my application I have an NSSearchField that is bound to an arraycontroller which performs searches as the user types. The problem is that the search field never resigns firstresponder-status once it receives it. What would be the cleanest way of…
Christoffer
  • 25,035
  • 18
  • 53
  • 77
2
votes
1 answer

In UITableViewCell make UISwitch get the click then accesoryView if switch is on

I am trying to build a UITableViewCell that looks like this: Since I can't post an image yet I'll try to describe it by saying it's a label (left) with a UISwitch (middle) and the accessory (right). Hope ya'll get the picture... The idea is that…
user953175
  • 205
  • 3
  • 9
2
votes
1 answer

view cant become a first responder

I have a view controller. It is pushed by another's UINavigationController. In ViewController.m: - (BOOL)canBecomeFirstResponder { return YES; } - (void)viewDidAppear:(BOOL)animated { [self.view becomeFirstResponder]; NSLog(@"%d",…
SentineL
  • 4,682
  • 5
  • 19
  • 38
2
votes
1 answer

UIResponder class and first responder roles

I read in the UIResponder class reference: There are two general kinds of events: touch events and motion events. The primary event-handling methods for touches are touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and…
2
votes
2 answers

Is this a hacky way to go to the next UITextField (using textFieldShouldReturn)?

- (BOOL)textFieldShouldReturn:(UITextField *)sender { if(sender.returnKeyType == UIReturnKeyNext){ // Make something else first responder }else if(sender.returnKeyType == UIReturnKeyGo){ // Do something }else{ …
rnystrom
  • 1,906
  • 2
  • 21
  • 47