• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: commitEditing not committing edits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: commitEditing not committing edits


  • Subject: Re: commitEditing not committing edits
  • From: Jonathan Fewtrell <email@hidden>
  • Date: Fri, 28 Jan 2005 22:51:25 +0000


On 28 Jan 2005, at 16:50, email@hidden wrote:


Initially my problem was that if the user did not tab out of a field or press Enter, the edits in the 'active' field would not be committed when the button was clicked. Based on comments in a number of threads here, I added a line to the button action to send a "commitEditing" message to the NSObjectController. I was confident this would work, but it didn't. What have I missed?

That should be fine. Is the outlet to your object controller actually set?


mmalc

Yes, it was set. Turns out the problem was indeed that the "enabled" state of each of the NSTextFields was bound to the value of the button, so that the fields were disabled when the button was clicked and re-enabled when it was clicked again. Seems that this prevented the "commitEditing" method in the button action from being performed (I suppose the fields had been disabled before the "commitEditing" command had been reached). Interestingly, if I bind the "editable" state (as opposed to the "enabled" state) of the fields to the value of the button, everything works fine, ie, the editing is committed before the field becomes non-editable. This happens to be OK for my app, but it is slightly disconcerting that the two should behave differently.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: NSMatrix sending a message
  • Next by Date: Re: Debugging Bindings
  • Previous by thread: Re: commitEditing not committing edits
  • Next by thread: Interface Builder and text fields
  • Index(es):
    • Date
    • Thread