开发者

NSTextField value during edit is the field editors value. But I need the field's original value

When I send stringValue to a NSTextField when it's field editor is active,开发者_开发技巧 it returns the current value from the field editor. But I need the original value from the NSTextField before it started editing! How can I get it? (tried to get the stringValue from the NSTextFieldCell, but I get the field editors value too) Any suggestions how I can get the original value?


You shouldn't ask the text field for its value, you should obtain the value from the model object that the text field represents.

Never store model data in a view. You should store it in a model object which is linked to the view through some sort of controller.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜