• 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: NEWBIE: Why use protocols?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEWBIE: Why use protocols?


  • Subject: Re: NEWBIE: Why use protocols?
  • From: "Ben D. Jones" <email@hidden>
  • Date: Wed, 18 May 2005 14:50:14 -0400

Thanks Bob,
Thats what I was trying to get at. Couldn't figure out if it was an optional thing or that in some cases its required. Thanks man!


~Ben

On May 18, 2005, at 2:39 PM, Thomas Davie wrote:


On May 18, 2005, at 7:32 PM, Ben D. Jones wrote:


The reason I ask is that I'm actually starting on a very large project (my first big project) in Cocoa. Having done large projects in C I'm not a newbie to programming, just Cocoa. So in what cases (example of use) would it be needed or proper to use protocols?


It is never *needed* to use protocols in the same way as you could define every pointer in C as a void*, it's merely another convenience of the language that assists you the programmer in getting your job right. If an object is supposed to subscribe to a protocol, then the type checker can check that you haven't bungled your code for you :)


Bob


Ben D. Jones Apricle Technologies http://www.apricle.net


_______________________________________________ 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
References: 
 >NEWBIE: Why use protocols? (From: "Ben D. Jones" <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Cameron Hayne <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Daniel Jalkut <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Ondra Cada <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: "Ben D. Jones" <email@hidden>)
 >Re: NEWBIE: Why use protocols? (From: Thomas Davie <email@hidden>)

  • Prev by Date: Re: HTTP server with NetSocket
  • Next by Date: Re: NEWBIE: Why use protocols?
  • Previous by thread: Re: NEWBIE: Why use protocols?
  • Next by thread: Re: NEWBIE: Why use protocols?
  • Index(es):
    • Date
    • Thread