Questions tagged [responder-chain]

40 questions
45
votes
4 answers

Is there any way of asking an iOS view which of its children has first responder status?

In Mac OS X, you can find the first responder like this: [[self window] firstResponder] Is there any way of doing it in iOS? Or do you need to enumerate the child controls and send an isFirstRespondermessage to each one?
Tommy Herbert
  • 18,568
  • 14
  • 43
  • 56
31
votes
4 answers

What are the "First Responder" and "Exit" boxes purpose in the storyboard editor?

In the XCode IDE, at the bottom of the view controller in the MainStoryboard editor, are two boxes: First Responder, and Exit. I know what a firstResponder is programatically within the code, but in the storyboard editor, I can't seem to do anything…
Madivad
  • 2,285
  • 4
  • 26
  • 56
13
votes
5 answers

UITableViewCell skipped in responder chain

I'm attempting to trigger an event in a subview of a UITableViewCell, and let it bubble up the responder chain and be handled by a custom UITableViewCell subclass. Basically: SomeView.m (which is a subview of the UITableViewCell) [self.button…
Keith Norman
  • 475
  • 4
  • 11
8
votes
1 answer

Scroll parent scroll view when child scroll view reaches end

I have a child scroll view contained within a parent scroll view (not a direct child). What I want is for the parent scroll view to start scrolling in the same direction as soon as the child scroll view reaches the end of its content. This kind of…
oyvindhauge
  • 3,354
  • 2
  • 28
  • 40
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
  • 12,147
  • 8
  • 58
  • 110
4
votes
1 answer

Cocoa: Forward actions (copy:, paste: etc.) up to the responder chain

I have a subclass of NSOutlineView that implements copy:, paste:, cut: etc. Also, the NSDocument subclass implements these same methods. When the outline view is in the responder chain (is first responder or a parent view of it), all copy/paste…
Micha Mazaheri
  • 3,280
  • 1
  • 17
  • 23
3
votes
1 answer

How to get UITableView header view to come before table cells in responder chain?

I have a rather large table header view above my table view. I have a number of subviews in that header view. I am doing something a bit nonstandard where I am "sticking" some of those subviews (but not all) at the top of the table view. My problem…
danbretl
  • 624
  • 6
  • 14
3
votes
2 answers

addTarget:action:forControlEvents: selector syntax when target is nil?

I would like a parent ViewController to handle Target-Actions generated by one of its child ViewControllers. According to the Apple docs this should be possible by setting target to nil and following the responder chain. If you specify nil for the…
MH175
  • 1,831
  • 1
  • 14
  • 28
3
votes
2 answers

Prevent Escape key from closing an NSPanel with a close box

Does anyone know the best way to prevent an escape key from closing an NSPanel when it's the key window? My panel is a child window and I want it to behave a little more like semi-permanent part of the window, more like a drawer, and for the text…
Pierre Houston
  • 1,571
  • 19
  • 31
2
votes
1 answer

Handling NSSegmentedControl selected segment change in Cocoa

Forgive the super noob question, but I've been googling this for the past hour and am getting frustrated that I can't seem to find an answer to such a very basic question: How do I handle control changes in Cocoa? I'm coming from iOS, and it's clear…
devios1
  • 33,997
  • 43
  • 149
  • 241
2
votes
0 answers

Unwind Segue out of a UIPopoverController

I've got UIViewController that I've loaded from a UIStoryboard by sending it initialViewController (it is not my App's main storyboard). I have an unwind segue used in that storyboard. Its exit point is in an unwind action of a UIViewController…
Benjohn
  • 12,147
  • 8
  • 58
  • 110
2
votes
0 answers

NSDocument is not in the responder chain

According to the doc (cf. fig 1.10), the NSDocument should be in the responder chain. However, if I try to log the responder chain via the method - (IBAction)logResponderChain:(id)sender { NSResponder *responder = self.view; while…
Colas
  • 3,225
  • 3
  • 25
  • 61
2
votes
1 answer

Removing an action from a subclass

My NSDocument subclass implements selectAll:. Only problem is, I'm using NSTableView, and it also implements selectAll:. However, the selectAll: action in NSTableView doesn't do what I want, and it does prevent the selectAll: method in my Document…
Jim Rea
  • 141
  • 7
1
vote
1 answer

set responder chain between two nsbuttons in IB

I have two nsbutton in my window.I need to link between these two in a way that,if the user press tab focus should go to the next button. I know how the responder chain works.My Question is How to do this in interface builder.Please help.
Akbar
  • 1,509
  • 1
  • 15
  • 30
1
vote
0 answers

event touchesForView: returns null in super view

I have a subclass of UIView called BigView that overrides touchesMoved (among other things) like so: @implementation BigView - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { NSSet * viewTouches = [event touchesForView:self]; …
Gregor
  • 515
  • 6
  • 17
1
2 3