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
0
votes
1 answer

How to handle first responder status for NSTextField subclass?

I'm working on a project which needs a special text field to edit byte values. My current solution is a dedicated readonly textfield and a "..." button to open a popover as shown in the image below: Now I try to make my solution more user friendly.…
Flovdis
  • 2,945
  • 26
  • 49
0
votes
1 answer

textBox is not firstResponder even though it is the only textBox I have picked

As soon as I run the program, I select the first textBox and then select a second textBox. fNameDone runs when textBox 1 touchUpOutside.The NSLogs are there to check if the textbox is the first responder and both nslogs return false. But it is the…
Johnny Cox
  • 1,873
  • 3
  • 17
  • 17
0
votes
2 answers

When textfield become first responder, gesture recogniser not responding, even after resign

I've probably missed something... First, I inherited from UITextField and added a Tap gesture recogniser to a UITextField (in the designated initialiser): UITapGestureRecognizer * ges = [[UITapGestureRecognizer alloc] initWithTarget:self…
0
votes
1 answer

OS X bindings: UI element isn't committing binding. Why is that?

Look at the simple app screenshot below. There is a text field and a segmented control. There are three bindings in play: textfield value binding goes to NSUserDefaultsController values.TextValue textfield alignment binding goes…
0
votes
1 answer

Issue with custom number pad in iOS app

I have an app with a custom number pad. I need the custom number pad for some, but not all of the text fields on a preferences view. I have written this method to set up the number pad for certain text…
Pheepster
  • 6,045
  • 6
  • 41
  • 75
0
votes
1 answer

Disabling copy operation in QLPreviewController

Is there any way to disable copy of content when we are viewing a text file, in QLPreviewController? I tried to sub-class it and override- canBecomeFirstResponder and returned NO, but it did not work :-( Please suggest.
Devarshi
  • 16,440
  • 13
  • 72
  • 125
0
votes
1 answer

How do I perform an action in response to an item being added to an NSArrayController's content?

I have an NSArrayController whose content is the "servers" property of my AppDelegate. I have an NSTextField which is bound to the "selection.name" property of the NSArrayController and I have buttons attached to the "add:" and "remove:" actions on…
Michael Bishop
  • 4,240
  • 3
  • 37
  • 41
0
votes
1 answer

Unable to refocus UITextField after storing pointer and resigning first responder

I am working with a grouped UITableView each containing a subclassed UITextField as its content view. The subclassed UITextField only contains an additional property indexPath to store its position within the table. The issue I face is that I want…
etridas
  • 11
  • 2
0
votes
0 answers

How do I make sure when I change to different views each is set as the First Responder?

I have an app that uses a tab bar controller with 5 different tabs using one viewcontroller (UIViewController). On the primary viewcontroller there is an audio function to play audio and when I switch to other views, I am no longer able to use the…
James Gunaca
  • 13
  • 1
  • 5
0
votes
1 answer

Correct way to set keypressed event on UITextField

I'm trying to create blood pressure app with simple controls to add results. To make it simpler I decided that when user types 3 characters in systolic pressure, then app should move cursor (and first responder) to diastolic value, and then to…
user2631838
0
votes
1 answer

When would a view controller become the first responder?

I'm learning about the responder chain in iOS and about first responders and I was wondering , what are the use cases that a UIViewController would become or need to become a first responder? For example, I'm doing an animation on a UILabel so that…
barndog
  • 6,975
  • 8
  • 53
  • 105
0
votes
1 answer

UICollectionViewCell lost first responder after scrolling out of sreen

I have UICollectionViewCell with UITextView. When I tap on textView, it becomes firstResponder, but when I scroll out and scroll that cell back to visible area there is no marker anymore on it, though keyboard is still visible. If I try to type…
0
votes
1 answer

how to know if UICollectionViewCell is about to be dequed?

How can I get informed when UICollectionViewCell is about to be scroll out from superview (will be queued)? I need to resignFirstResponder from that cell before the cell is queued.
0
votes
1 answer

Dismissing keyboard when user touches view

How can one dismiss the numeric keyboard when a user touches outside it? I have found a good bit of documentation online but it seems to be outdated and isn't very clear on where any of this code goes. I have tried using: -…
sdfrien
  • 37
  • 6
0
votes
1 answer

iOS: Can nextResponder be another app?

This question is related (inspired) to my previous question: iOS: Handle remote-control events and then relay the events to music apps My app can become the first responder to remote-control events. However, I'd like my app to relay the…
kakyo
  • 10,460
  • 14
  • 76
  • 140