• 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: DO: Protocols and Categories don't play nice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: DO: Protocols and Categories don't play nice (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: iTunes style searching on an NSTableView
  • Next by Date: [NSColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]
  • Previous by thread: Re: DO: Protocols and Categories don't play nice
  • Next by thread: [NSColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace]
  • Index(es):
    • Date
    • Thread