How to end NSTextField's editing session programmaticaly?

Discussion in 'Mac Programming' started by HARDWARRIOR, Mar 14, 2009.

  1. HARDWARRIOR macrumors member

    Nov 17, 2008
    I have a table in my app. Each row has several text fields. For editing I use poping NSPanel, not NSTableView itself. I use bindings from NSTextFields values to NSArrayController first selected record.
    After selecting a record in tableview and clicking edit button (or double clicking on record) editPanel shows up. Now if user edited on of textFields he must hit return or change focus in order that recently edit textField to commit editing to nsarraycontroller through bindings. So if user will open edit panel, change some textfield AND THEN CLICK ON CLOSE BUTTON OF THAT PANEL editing wont be commited. I can intercept that click on close button, but what code should I use to commit editing? Also is it possible for editing to commit in real-time, I mean while user typing can textfield update model through bindings?
  2. kainjow Moderator emeritus


    Jun 15, 2000
    Try checking "Continuously Updates Value" in the Bindings inspector under Value.
  3. HARDWARRIOR thread starter macrumors member

    Nov 17, 2008

Share This Page