-commitEditing NSAlert not always presented as a sheet
-commitEditing NSAlert not always presented as a sheet
- Subject: -commitEditing NSAlert not always presented as a sheet
- From: Keith Duncan <email@hidden>
- Date: Tue, 23 Feb 2010 15:05:16 +0000
I have a text field whose value is bound to a property which is validated.
When editing the field and hitting enter, if the value fails to validate the error is presented as a sheet - this is the desired behaviour.
However, if I click my 'Done' button, which first attempts to -commitEditing for the hosting view controller, and will then close the hosting child window if -commitEditing returns YES; the error is presented as a floating window - this is not the desired behaviour.
The difference I have observed is that when hitting the enter button whilst editing the text view, -textShouldEndEditing: is called. When -commitEditing is called on the view controller (and forwarded to the registered editors) -commitEditing is called on the NSValueBinder.
I explored the call graph and found that the window byref argument to +[NSTextValueBinder _prepareAlertError:responder:responderCandidate:window:recoveryAttempter:] is always NULL.
One solution would be to have my view controller explicitly resign the text field as first responder to simulate the first behaviour, but I'd rather fix the problem than the symptom. Or is this simply a bug in AppKit?
Thanks,
Keith_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden