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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to