gpt4 book ai didi

swift - 快速查找 .icns 文件

转载 作者:可可西里 更新时间:2023-11-01 01:32:58 24 4
gpt4 key购买 nike

这是我的代码。所有行都执行但只有最后一行有效,因为那是必须执行的最后一行。有谁知道我如何将所有这些代码放在一行中或让所有行都实际执行。谢谢

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)

}

最佳答案

我想所有的行都执行了,但是你改变了 theImageIcon.image 的值三次,所以你可以在最后看到第三个。

关于swift - 快速查找 .icns 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38939880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com