【问题标题】:Access text variable of NSTextField?访问 NSTextField 的文本变量?
【发布时间】:2018-02-04 22:44:54
【问题描述】:

我想访问 NSTextField 的 text 变量?

我试过这个。但它不起作用。

name = textfield.text

错误:“'NSTextField' 类型的值没有成员 'text'”

【问题讨论】:

  • name = textfield.stringvalue

标签: swift macos nstextfield


【解决方案1】:

您是否将它与 iOS 上的 UITextField 混淆了? Mac OS X 上对应的属性是stringValue

name = textfield.stringValue

【讨论】:

    猜你喜欢
    • 2012-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-07
    • 1970-01-01
    • 1970-01-01
    • 2022-11-14
    相关资源
    最近更新 更多