• 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 isEqual
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEvent isEqual


  • Subject: Re: NSEvent isEqual
  • From: John Stiles <email@hidden>
  • Date: Wed, 3 May 2006 15:24:37 -0700

If the pointer is the same, then by definition its contents must be the same, right?


On May 3, 2006, at 3:15 PM, Ken Victor wrote:

ondra,
thanx for this and your first post.

just comparing pointers as you suggest below is probably sufficient, but there is a possibility (albeit probably very small) that if stack/heap is reused that a pointer compare would yield a false positive. thus, to be truly safe (so i don't have to debug it 5 years from now :-) ), in my code i define "identity" as being the same pointer AND isEqual being true. (suspenders and a belt!)

ken



At 12:05 AM +0200 5/4/06, Ondra Cada wrote:
Ken,

oh, I have overlooked this:

On 3.5.2006, at 23:46, Ken Victor wrote:

ps. in an attempt to stave off a series of questions, i need to know if a change to a date picker's value was caused by the same event that made the date picker the current first responder, ie, by the user clicking in one of the date pickers arrows when the date picker wasn't the first responder

Actually, I may be misunderstanding the goal mightily, but seems to me this is the very case you want identity (instead of equality)? In other words, something like


NSEvent *oldEvent; // no need to retain unless you wanna log it or something
...
if (oldEvent==newEvent) ...
---
Ondra Ă¢ada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSEvent isEqual
      • From: Matt Gough <email@hidden>
References: 
 >NSEvent isEqual (From: Ken Victor <email@hidden>)
 >Re: NSEvent isEqual (From: Ondra Cada <email@hidden>)
 >Re: NSEvent isEqual (From: Ken Victor <email@hidden>)

  • Prev by Date: Re: NSEvent isEqual
  • Next by Date: Re: NSEvent isEqual
  • Previous by thread: Re: NSEvent isEqual
  • Next by thread: Re: NSEvent isEqual
  • Index(es):
    • Date
    • Thread