开发者

why does the uitextfield never return nil when it becomes first responder?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜