Re: Adding an event handler to an NSView subclass using categories
Re: Adding an event handler to an NSView subclass using categories
- Subject: Re: Adding an event handler to an NSView subclass using categories
- From: "John C. Randolph" <email@hidden>
- Date: Sun, 6 May 2007 06:56:48 -0700
On May 6, 2007, at 5:26 AM, Yann Bizeul wrote:
After a look at the documentation on categories, I noticed that :
"When a category overrides an inherited method, the new version can,
as usual, incorporate the inherited version through a message to
super. But there’s no way for a category method to incorporate a
method with the same name defined for the same class."
Well, english is not my spoken language, so fix me if I'm wrong, but
that means to me that :
A category should not implement a method declared in the class it
extends
A category could implement a method *inherited* from super
So if graphView does implement menuForEvent: then you can't override
it in your category and you'll have to subclass.
Anyone to confirm this ?
That is correct.
-jcr
“The two most important tools an architect has are the eraser in the
drawing room and the sledge hammer on the construction site. ”
-Frank Lloyd Wright
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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