这是我的代码。所有行都会执行,但只有最后一行有效,因为这是必须执行的最后一行。有人知道如何将所有这些代码放在一行中,或者让所有行都实际执行吗?谢谢
override func controlTextDidChange(notification: NSNotification) {
let url = NSURL(fileURLWithPath: "/Applications/\(Search.stringValue).app/Contents/Resources/AppIcon.icns")
Theimageicon.image = NSImage(byReferencingURL: url)
let url2 = NSURL(fileURLWithPath: "/Applications/\(Search.stringValue).app/Contents/Resources/icon.icns")
Theimageicon.image = NSImage(byReferencingURL: url2)
let url3 = NSURL(fileURLWithPath: "/Applications/\(Search.stringValue).app/Contents/Resources/\(Search.stringValue).icns")
Theimageicon.image = NSImage(byReferencingURL: url3)
}发布于 2016-08-14 15:05:59
我认为所有行都会执行,但是您更改了theImageIcon.image的值三次,所以您可以在末尾看到第三行。
https://stackoverflow.com/questions/38939880
复制相似问题