如何在NSTextField中设置文本? [英] How do you set the text in an NSTextField?
本文介绍了如何在NSTextField中设置文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在NSTextField中设置文本,但是-setStringValue:
和-setTitleWithMnemonic:
方法不起作用.有什么想法吗?
I'm trying to set the text in an NSTextField, but the -setStringValue:
and -setTitleWithMnemonic:
methods are not working. Any ideas?
推荐答案
setStringValue:
是做到这一点的方法.您应该确保正确设置插座. (在调试器中,确保您的textfield变量不为null.)
setStringValue:
is the way to do it. You should make sure your outlet is being set properly. (In the debugger, make sure your textfield variable is not null.)
这篇关于如何在NSTextField中设置文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文