resignFirstResponder not hiding keyboard on textFieldShouldReturn

后端 未结 14 1738
我在风中等你
我在风中等你 2020-12-05 10:11

I have a view with a UITextField which should hide the keyboard when return is pressed.

My function is this:

- (BOOL)textFieldShouldReturn:(UITextFie         


        
14条回答
  •  我在风中等你
    2020-12-05 10:45

    If you are using the Interface Builder, look if your UITextField has the delegated linked with your class.

    -Select your UITextField and in your Connections look if exits one connection in Outlets->delegate. If not, conect with you File's Owner Class.

    This need to be linked with your File's Owner Class. This delegate tell where to search for a method. If your are overriding a method, you need to tell where the object will search for that.

提交回复
热议问题