when i make my textfield become first responder, the text field never returns 开发者_如何学Pythonnil, even if i force it to be nil by myTextField.text = nil; as soon as i comment out the "[myTextField becomeFirstResponder];" the text field is able to return nil. anybody have any idea why?
Becoming first responder initializes the internal NSString that holds the text you type to an empty string: @"", thus no longer nil. Being firstResponder is a persistent action, in order to always have a valid NSString in there when the user begins to type.
精彩评论