Skip to main content

Protocols

  • Chapter
  • 682 Accesses

Abstract

In the previous chapter, we talked about the magic of categories and informal protocols. When you use an informal protocol, as you saw in Chapter 12, you implement only the methods you want to respond to. For the NSNetServiceBrowser delegate in Chapter 12, we implemented only the two methods that get called when a new service is added to or removed from the network: we didn’t have to implement the six other methods in the NSNetServiceBrowserDelegate informal protocol. We also didn’t have to declare anything in our object saying that we’re usable as an NSNetServiceBrowser delegate. It all just worked with a minimum of fuss.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Mark Dalrymple and Scott Knaster

About this chapter

Cite this chapter

Dalrymple, M., Knaster, S. (2009). Protocols. In: Learn Objective-C on the Mac. Apress. https://doi.org/10.1007/978-1-4302-1816-6_13

Download citation

Publish with us

Policies and ethics