Re: Stop NSScrollView from catching scroll events.
Re: Stop NSScrollView from catching scroll events.
- Subject: Re: Stop NSScrollView from catching scroll events.
- From: Kyle Sluder <email@hidden>
- Date: Mon, 23 Mar 2009 17:46:16 -0400
On Mon, Mar 23, 2009 at 5:35 PM, Ben Lachman <email@hidden> wrote:
> How do you call through to some arbitrary class in a class's inheritance
> chain?
Typically, you don't. Just hand it off to super. NSView isn't
declared to implement -scrollWheel:.
If you *really* need to invoke a specific class's implementation of a
method, use class_getInstanceMethod to get the method's
implementation, and then just invoke that implementation:
// Warning: written in mail client, YMMV etc.
- (void)scrollWheel:(NSEvent *)theEvent
{
Method theMethod = class_getMethod([NSResponder class],
@selector(scrollWheel:));
IMP theImpl = method_getImplementation(theMethod);
(void (*) (id, SEL, NSEvent*))(theImpl)(self,
@selector(scrollWheel:), theEvent);
}
--Kyle Sluder
_______________________________________________
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