• 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: Ondra Cada <email@hidden>
  • Date: Thu, 4 May 2006 00:02:57 +0200

Ken,

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

can anyone tell me if NSEvent overrides isEqual

Yep, your own developer's kit:

10 /tmp> >q.m
#import <Cocoa/Cocoa.h>
int main() { [NSAutoreleasePool new];
SEL s=@selector(isEqual:);
NSLog(@"%x %x",[NSEvent instanceMethodForSelector:s],[[NSEvent superclass] instanceMethodForSelector:s]);
return 0;
}
11 /tmp> cc -Wall q.m -framework Cocoa && ./a.out
2006-05-03 23:54:59.721 a.out[14940] 93690a70 928d8168
12 /tmp>


to do more than simply check 2 pointers?

Yep:

12 /tmp> >q.m
#import <Cocoa/Cocoa.h>
int main() { [NSAutoreleasePool new];
NSEvent *a=[NSEvent new],*b=[a copy];
NSLog(@"%x %x %d",a,b,[a isEqual:b]);
return 0;
}
13 /tmp> cc -Wall q.m -framework Cocoa && ./a.out
2006-05-03 23:57:37.098 a.out[14958] 506950 5069b0 1
14 /tmp>

equally important, can anyone tell me how i could have discovered this myself?

Depending on what exactly you need the just-try-it method above may help you much (you need the current state of affairs) or not at all (you need the API contract--well, I guess here the API contract is "whatever we, Apple, consider convenient" :)).


its not at all apparent from any of the docs or searches i've done.

I agree this might be documented better, namely, by outlining the extent of isEqual: implementation for those classes which have any (huh, first time I tend to agree somewhat with a documentation rant in a long long time! :)).
---
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: This email sent to email@hidden
References: 
 >NSEvent isEqual (From: Ken Victor <email@hidden>)

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