如何将数据从NSTextField添加到Core Data属性,而无需在编辑TextField之后按Return或Tab键? [英] How to add data from an NSTextField to a Core Data Attribute without having to press Return or Tab after editing the TextField?
问题描述
我使用带有3个NSTextFields的表单和一个Cancel和OK按钮来编辑Core Data Entity的属性。
在NSTextFields中输入的文本仅在Core Data Entity中更新,如果我在NSTextField中写入后按Tab或Return,或者如果我使用鼠标聚焦另一个NSTextField。如果我只是在NSTextField输入文本,并按OK按钮输入的文本丢失。
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.
有一些属性,我可以在Interface Builder中设置更改此NSTextField行为?
Is there some attribute i can set in Interface Builder to change this NSTextField behaviour?
推荐答案
在我的例子中的答案是检查NSTextField的值绑定中的连续更新值选项。
对于相同问题的其他答案,请参阅:红毛衣博客 - 保持反应: http://www.red-sweater.com/blog/229/stay-responsive
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
这篇关于如何将数据从NSTextField添加到Core Data属性,而无需在编辑TextField之后按Return或Tab键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!