How do I change an NSImageView object to its alternate image in Objective C applescript?

拈花ヽ惹草 提交于 2019-12-12 03:47:03

问题


Using Xcode I am trying to change an image object to another image. I am using ObjC Applescript. I have an IB Outlet testImage : missing value and using tell testImage to setImage("sample.png") to change the image.


回答1:


The following code should do the trick:

set image to current application's NSImage's imageNamed_("sample.png")
testImage's setImage_(image)


来源:https://stackoverflow.com/questions/42965369/how-do-i-change-an-nsimageview-object-to-its-alternate-image-in-objective-c-appl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!