我正在学习Swift以及如何通过Xcode创建应用程序。
我正在创建一个应用程序,并希望从Apple文档中了解这一点。
从这段代码:
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
@IBOutlet weak var myLabel: NSTextField!
func applicationDidFinishLaunching(aNotification: NSNotification) {
}
@IBAction func clickBtn(sender: NSButton) {
myLabel.stringValue = "Testing"
}
}
我想知道NSTextField
的含义,因此我查看了:Apple NSTextField Class Reference
但我在本文档中找不到stringValue
方法。
OSX / iOS代码的每个部分的文档在哪里?
答案 0 :(得分:2)
在您在顶部引用的页面上,您将看到NSTextField
的继承链。您没有找到来自stringValue
的{{1}} - 点击继承链中的该类。
您可以在网络上找到该文档,并随Xcode提供。
HTH