Re: NSPopover + Bindings + Validation = Weirdness
Re: NSPopover + Bindings + Validation = Weirdness
- Subject: Re: NSPopover + Bindings + Validation = Weirdness
- From: Keary Suska <email@hidden>
- Date: Mon, 26 May 2014 07:50:10 -0600
On May 26, 2014, at 3:05 AM, Jonathan Mitchell wrote:
>
> On 26 May 2014, at 01:04, Keary Suska <email@hidden> wrote:
>
>> I am implementing an editing view in a popover, and discovered that validations messages will cause exceptions because AppKit is broken in that regard...anyway so I set "always use application modal alerts" and that seems to work although the API is beeping somewhere after the alert is dismissed and I can't seem to find out why. This only happens when tabbing out of the field. I have a "commit" button that calls commitEditing and the validation message appears and there is no beep when it is dismissed.
> Have you tried overriding :
>
> NSResponder - (void)presentError:(NSError *)error modalForWindow:(NSWindow *)aWindow delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo
>
> You can access the NSWindow instance at popoverObject.contentViewController.view.window;.
>
> It might be possible to work around the AppKit bug.
The bug is triggered when trying to display a sheet on a popover window, so even if I capture error presentation I would still have to present a modal alert of some kind. I was hoping the API would do that for me gracefully, but I was apparently wrong. I could give it a try and see if it behaves better.
>> I suspect that the tab key event is somehow not being handled and is passed up the responder chain to something that doesn't like it so beeps.
> This seems likely.
> You could try just handling this event yourself within the responder chain.
>
> I find that using XSViewController improves the whole NSView + responder chain experience.
I do force insert my view controller into the responder chain, although really just to capture -cancelOperation calls so I can dismiss popovers with the ESC key. Perhaps this is the problem. I will look up that alley as well.
Thanks,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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