• 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: Stop NSScrollView from catching scroll events.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Stop NSScrollView from catching scroll events. (From: Ben Lachman <email@hidden>)
 >Re: Stop NSScrollView from catching scroll events. (From: Michael Ash <email@hidden>)
 >Re: Stop NSScrollView from catching scroll events. (From: Ben Lachman <email@hidden>)

  • Prev by Date: Re: Stop NSScrollView from catching scroll events.
  • Next by Date: Re: Stop NSScrollView from catching scroll events.
  • Previous by thread: Re: Stop NSScrollView from catching scroll events.
  • Next by thread: Re: Stop NSScrollView from catching scroll events.
  • Index(es):
    • Date
    • Thread