Re: Calling commitEditing text field loses focus

Kyle Sluder <[email protected]> Tue, 20 Dec 2011 12:50:01 -0800
Newsgroups gmane.comp.macosx.devel
Message-ID <CANEs-cy5Mz1i-R6MKhT0nGtGxDMmEpuhHCJ-YtNixodX25R9jA@mail.gmail.com>
On Tue, Dec 20, 2011 at 5:14 AM, Christiaan Hofman <[email protected]> wro=
te:
> I have a text field whose value is bound through an NSObjectController. B=
efore performing certain actions I call -commitEditing on that object contr=
oller to make sure I have the current value from the text field. What I not=
ice is that if there are any uncommitted changes to the text, the text fiel=
d loses focus due to this call. This is certainly not what I want, I just w=
ant to commit the edit. I also don't recall this to happen in the past, but=
 I am not sure for how long this has been going on. Also, the focus is not =
lost when the text had not changed since the last commit. To me this sounds=
 like a bug. Can anyone confirm this is a bug, or tell me why this would ma=
ke sense? Or tell me whether there is some kind of setting to change this b=
ehavior?

Try using -commitEditingAndReturnError: (new in 10.7) instead?

--Kyle Sluder