Re: who is currently the first responder? (iOS)
Re: who is currently the first responder? (iOS)
- Subject: Re: who is currently the first responder? (iOS)
- From: Matt Neuburg <email@hidden>
- Date: Wed, 29 Jun 2011 08:56:24 -0700
On Wed, 29 Jun 2011 21:12:50 +0800, Roland King <email@hidden> said:
>Is there a way to find out what UIResponder is the current first responder, the one with the keyboard up?
No. I devote some space to ranting about this in my book. The app obviously *knows* who the first responder is, so why won't it tell you?
My workaround is to implement delegate methods on all my UITextFields and store a reference to the text field in an instance variable when it starts being edited. Oh, and as I warn in the book, do NOT name that instance variable "firstResponder" or your app will fall to its knees; guess how I found *that* out? :)
>I want to make the edit commit
Oh. Well, if that's your only problem, then all you have to do is call endEditing: on the superview.
m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden