문제

I'm working with an NSDatePicker and an NSTextField to update the text field whenever the NSDatePicker's value changes.

In Objective-C, I would use this method:

     datePicker addTarget:self 
                   action:@selector(dateChanged:)
         forControlEvents:UIControlEventValueChanged

I've converted this method into the following AppleScriptObjC code:

     datePicker's addTarget_action_forControlEvents_(me, ¬ 
                  @selector(dateChanged_), ¬
                  (current application's UIControlEventValueChanged))

However, this causes the build to fail. In place of @selector(dateChanged_), I've also tried "@selector(dateChanged:)", "@selector(dateChanged_)", and dateChanged_; no luck so far.

What is the correct way to convert this method to AppleScriptObjC?

도움이 되었습니까?

해결책

Not tried, but it should be

datePicker's addTarget_action_forControlEvents_(me, "dateChanged:", (current application's UIControlEventValueChanged))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top