• 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: Protocol implementation split between base and derived class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Protocol implementation split between base and derived class


  • Subject: Re: Protocol implementation split between base and derived class
  • From: Christian Brunschen <email@hidden>
  • Date: Wed, 8 Dec 2004 23:51:18 +0000


On 8 Dec 2004, at 23:15, Scott Hancher wrote:

You are correct. This would eliminate the compiler warning. However, I want to leverage the compiler to warn me when I haven't implemented all the protocol methods. Adding placeholder methods that throw an exception would quiet the warning but would hide a potential error that I would then have to uncover through more time consuming testing.

I would argue that my example Foo implements both of the FooProtocol methods that it proclaims to conform to. The fact that one of the two protocol methods is implemented on the base class it derives from is immaterial.

How about you declare two protocols - one for the superclass, and one for the subclass which just happens to include all the same methods as the superclass' protocol?


++Scott.

// Christian Brunschen

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Protocol implementation split between base and derived class
      • From: Scott Hancher <email@hidden>
References: 
 >Re: Protocol implementation split between base and derived class (From: Scott Hancher <email@hidden>)

  • Prev by Date: Re: reversing an NSString
  • Next by Date: Help with runtime warning
  • Previous by thread: Re: Protocol implementation split between base and derived class
  • Next by thread: Re: Protocol implementation split between base and derived class
  • Index(es):
    • Date
    • Thread