【发布时间】:2018-02-04 22:44:54
【问题描述】:
我想访问 NSTextField 的 text 变量?
我试过这个。但它不起作用。
name = textfield.text
错误:“'NSTextField' 类型的值没有成员 'text'”
【问题讨论】:
-
name = textfield.stringvalue
标签: swift macos nstextfield
我想访问 NSTextField 的 text 变量?
我试过这个。但它不起作用。
name = textfield.text
错误:“'NSTextField' 类型的值没有成员 'text'”
【问题讨论】:
标签: swift macos nstextfield
您是否将它与 iOS 上的 UITextField 混淆了? Mac OS X 上对应的属性是stringValue
name = textfield.stringValue
【讨论】: