• 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: NSEvent locationInWindow undefined for non-mouse events, how to catch?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?


  • Subject: Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?
  • From: Seth Willits <email@hidden>
  • Date: Tue, 14 Feb 2012 13:40:28 -0800

On Feb 13, 2012, at 1:25 PM, Sean McBride wrote:

> The NSEvent locationInWindow docs say: "For non-mouse events the return value of this method is undefined."
>
> I've just been bitten by this.  Seems it would be easy to detect at runtime and assert, is there any magic environment variable or defaults value that can help me catch such incorrect usage?  I've searched but not found...

Not that I know of, but if you really wanted to, you could swizzle the method and do an event type check and throw an exception if it's a non-mouse event, otherwise call Cocoa's method.


--
Seth Willits

_______________________________________________

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


References: 
 >NSEvent locationInWindow undefined for non-mouse events, how to catch? (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: How can I detect a mouse click outside a child window on Leopard?
  • Next by Date: Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?
  • Previous by thread: NSEvent locationInWindow undefined for non-mouse events, how to catch?
  • Next by thread: Re: NSEvent locationInWindow undefined for non-mouse events, how to catch?
  • Index(es):
    • Date
    • Thread