当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Is there a NSNotification for objects that become first resoponder?

问题描述:

Is there a NSNotification for objects that become first responder.

Like NSNotification that give me the UITextfield that cause the keyboard to pop up?

网友答案:

Check UITextFieldTextDidBeginEditingNotification, the textField that started editing is in notification's object property.

There're also UIKeyboardWillShowNotification and UIKeyboardDidShowNotification notifications

网友答案:

Another option is to have your view controller be a delegate to the UITextField. UITextFieldDelegate has a textFieldDidBeginEditing: method.

网友答案:

No, But you could check it manually by using "IsFirstResponder" (BOOL).. Can you explain a little bit more what you want to accomplish? Maybe there is a way to use another notification.

分享给朋友:
您可能感兴趣的文章:
随机阅读: