Re: warning 'NSEvent' may not respond to '+eventWithEventRef:'
Re: warning 'NSEvent' may not respond to '+eventWithEventRef:'
- Subject: Re: warning 'NSEvent' may not respond to '+eventWithEventRef:'
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 26 May 2009 11:11:18 -0400
I sent this reply to Ken but neglected to send it to the list.
On May 26, 2009, at 12:52 AM, Ken Tozier wrote:
'm getting a warning when calling NSEvent's eventWithEventRef
NSEvent *event = [NSEvent eventWithEventRef: ref];
I include Appkit and Carbon in the file where this warning appears
#import <AppKit/AppKit.h>
#import <Carbon/Carbon.h>
And the documentation doesn't say this is an obsolete method
That method was introduced in Leopard to enable you to augment what
you can do with the NSEvent API by getting the CGEventRef opaque
object that lies behind the NSEvent object. Once you have the
CGEventRef object, you can use the Quartz Event Taps API to do things
that aren't available in NSEvent. Event taps are documented in Apple's
"Quartz Event Taps Reference" document. Download my free Event Taps
Testbench application at prefabsoftware.com/eventtapstestbench for
more information.
To answer your question, add this line to your code file:
#import <CoreGraphics/CoreGraphics.h>
I forget whether you have to link to Carbon, but I don't think so --
unless you need it for some other reason.
--
Bill Cheeseman
email@hidden
_______________________________________________
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