Re: DO: Protocols and Categories don't play nice
Re: DO: Protocols and Categories don't play nice
- Subject: Re: DO: Protocols and Categories don't play nice
- From: AgentM <email@hidden>
- Date: Mon, 6 Oct 2003 22:42:25 +0200
Ah! It didn't occur to me that I could apply a protocol to a category
and then wrap them all up. Thanks! Still, this means that I would have
to have identical, mirrored definitions of the class and protocol
messages for the sole purpose of providing the final wrapped-up
protocol to a single selector. The protocol is otherwise useless and
makes my code harder to maintain. Is there truly no more elegant
solution to this?
On Monday, Oct 6, 2003, at 22:30 Europe/Berlin, Greg Titus wrote:
On Monday, October 6, 2003, at 01:20 PM, AgentM wrote:
Am I missing something? How are other people doing this? Right now,
it looks least complicated to consolidate my categories into a
monster definition. Sorry for the long mail- I *really* don't want to
give up my categories....
You can inherit protocols from other protocols. For instance:
@protocol MyProtocol <NSObject, NSCoding, NSCopying>
@end
Means that MyProtocol has all the methods of the three other
protocols, and that's it.
Is that what you are aiming for?
Hope this helps,
- Greg
_______________________________________________
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.