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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights 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
DOI: https://doi.org/10.1007/978-1-4302-1816-6_13
Publisher Name: Apress
Print ISBN: 978-1-4302-1815-9
Online ISBN: 978-1-4302-1816-6
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)