Question

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?

Was it helpful?

Solution

Not tried, but it should be

datePicker's addTarget_action_forControlEvents_(me, "dateChanged:", (current application's UIControlEventValueChanged))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top