Search code examples
core-datacocoa-bindingsnsbutton

NSButton, binding question


I am trying a cocoa application with core-data. The application contains an entity: UsefulUrl with attribute: url. The entered urls are displayed in table view.

I am able to insert, modify and delete the entered urls from table via cocoa bindings (NSArrayController).

Now,

I want to open the urls of selected rows in browser, on click of a button, using cocoa bindings.

I think I can do it via button's bindings: Action Invocation - Argument/ Target, but I could not make it working.

Can anyone suggest me exactly how to do it or some useful url?

Thanks,

Miraaj


Solution

  • I was right... in the argument binding pane I binded the url of UsefulUrl and in target I binded the selector gotoUrl: in my controller class. In gotoUrl method I used NSWorkspace method to open the link in default browser and it is working as intended :)