• 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: NSPopover + Bindings + Validation = Weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSPopover + Bindings + Validation = Weirdness
      • From: Jonathan Mitchell <email@hidden>
References: 
 >NSPopover + Bindings + Validation = Weirdness (From: Keary Suska <email@hidden>)
 >Re: NSPopover + Bindings + Validation = Weirdness (From: Jonathan Mitchell <email@hidden>)

  • Prev by Date: Re: EXC_BAD_ACCESS in NSData
  • Next by Date: Re: NSPopover + Bindings + Validation = Weirdness
  • Previous by thread: Re: NSPopover + Bindings + Validation = Weirdness
  • Next by thread: Re: NSPopover + Bindings + Validation = Weirdness
  • Index(es):
    • Date
    • Thread