2
votes

I use a sheet with 3 NSTextFields and a Cancel- and OK-Button to edit the attributes of a Core Data Entity. The text entered in the NSTextFields is only updated in the Core Data Entity if i press Tab or Return after writing in the NSTextField or if i focus another NSTextField with the mouse. If i just enter text in an NSTextField and press the OK-Button the entered text is lost.

Is there some attribute i can set in Interface Builder to change this NSTextField behaviour?

1
My problem would have been better described like this: "In general, a user’s changes to a Cocoa NSTextField are saved when they finish editing (by tabbing or clicking to another field) or press return. This is fine, and it works 95% of the time. But on occasion we may find good reason to saved a user’s changes regardless of whether they’ve performed one of these completing actions.“ I found it on Red Sweater Blog: red-sweater.com/blog/229/stay-responsiveHelene Bilbo

1 Answers

2
votes

The answer in my case is to check the “continuously updates value” option in the NSTextField’s value binding. For other answers to the same problem see: Red Sweater Blog — Stay Responsive: http://www.red-sweater.com/blog/229/stay-responsive