Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 从键盘通知获取UITextField_Ios_Objective C_Nsnotificationcenter_Uikeyboard - Fatal编程技术网

Ios 从键盘通知获取UITextField

Ios 从键盘通知获取UITextField,ios,objective-c,nsnotificationcenter,uikeyboard,Ios,Objective C,Nsnotificationcenter,Uikeyboard,我正在尝试获取调用observerUIKeyboardDidShowNotification的UITextField 我的观察者在appdelegate中,我有几个UIViewController,其中有几个UIExtFields,简言之,我不知道当前的第一响应者 如何在键盘通知时触发的方法中获取第一个响应程序uikeyboarddishownotification?这无法从uikeyboarddishownotification简单地推断,因为它只包含以下信息。但是,检查一下这个,它有一个关于

我正在尝试获取调用observer
UIKeyboardDidShowNotification
UITextField

我的观察者在
appdelegate
中,我有几个UIViewController,其中有几个UIExtFields,简言之,我不知道当前的第一响应者


如何在键盘通知时触发的方法中获取第一个响应程序
uikeyboarddishownotification

这无法从
uikeyboarddishownotification
简单地推断,因为它只包含以下信息。但是,检查一下这个,它有一个关于如何获得当前第一响应者的绝妙解决方案

NSConcretenotify 0x7ff14d1ac0d0{name= UIKeyboardWillShowNotification;用户信息={ UIKeyboardAnimationCurveUserInfo=7; UIKeyboardAnimationDurationUserInfoKey=“0.25”; UIKeyboardBoundsUserInfoKey=“NSRect:{{0,0},{320,216}”; UIKeyboardCenterBeginUserInfo=“NSPoint:{160676}”; UIKeyboardCenterEndUserInfoKey=“NSPoint:{160460}”; UIKeyboardFrameBeginUserInfo=“NSRect:{{0,568},{320,216}”; UIKeyboardFrameEndUserInfoKey=“NSRect:{{0352},{320216}”; UIKeyboardIsLocalUserInfoKey=1;}}


如果您只需要知道什么文本字段才得到焦点,请考虑处理<代码> UITExtFieldTrimeDealEdgEngultEngult。它传递
对象
参数中的文本字段。调用UITextField时是否需要对项目进行一些更改?