AppleScriptObjC: ProgressBar does not increment
I am trying to implement a Progress bar update in AppleScriptObjC. I have connected the progressbar thru IB and trying to increment the Progressbar update via incrementBy(5). The Inderterminate property is set to false. the IB connection is fine because if I set the Inderterminate to true and uncomemnt the code to start/stop animation it works fine. this is the Error I get "-[NSProgressIndicator incrementby:]: unrecognized selector sent to instance 0x2007e2220"
following is the code
property ProgressBar : missing value
on MyBtnClick_(sender)
(*.. some code ..*)
ProgressBar's incrementby_(5)
ProgressBar's displayifNeeded()
--ProgressBar's startAnimation_(me)
--ProgressBar's stopAnimation_(me)
end MyBtnClick_
开发者_Go百科
Thanks in Adv for any pointers.
regards, Jesse
Try incrementBy_ -- case matters.
Ok so, "unrecognized selector sent to instance" means that the command sent is unknown so the command your sending to it means it does not exist, however If you are trying to send a message to make the progress bar to set its progress % then, i can help you! :D, I use the "setDoubleValue" command to set the Progress bars status and you don't need to startAnimation and stopAnimation it either :D
ok so here is a script that will store the current progress and when MyBtnClick is run, it will add 5% to the progress bar
property ProgressBar : missing value
property currentProgress : 0
on MyBtnClick_(sender)
(*.. some code ..*)
set currentProgress to currentProgress + 5
ProgressBar's setDoubleValue_(currentProgress)
end MyBtnClick_
hope this helps :D
精彩评论