Re: OBJ-C question
Re: OBJ-C question
- Subject: Re: OBJ-C question
- From: John Randolph <email@hidden>
- Date: Tue, 27 Apr 2004 15:59:47 -0700
On Apr 17, 2004, at 10:37 AM, Sherm Pendley wrote:
On Apr 17, 2004, at 1:13 PM, Ondra Cada wrote:
On 17.4.2004, at 18:59, Sherm Pendley wrote:
You could add default implementations of your methods as a category
to NSObject. That would also take care of the warnings for informal
protocols.
That's exactly what you DON'T WANT to. That's the whole point of
informal protocols--let the class to implement the method or not, and
behave accordingly.
I'm confused - your advice is seemingly contradictory to Apple's
practice. Looking at AppKit headers such as NSWindow.h,
NSOutlineView.h, and NSBrowserView.h, I see all of the delegate and/or
data source methods that are relevant to each class added to NSObject
as a category.
They're *declared* as categories of NSObject. They're not implemented.
Those declarations are there for the benefit of silencing compiler
warnings.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.