Re: NSEvent isEqual
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