O'Reilly logo

Objective-C Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 24

image

Delegation

Delegation Defined

Delegation is a design pattern where one object asks another object for help. Protocols are an important part of Delegation, because protocols define how an object will be helped.

Delegation works by defining a protocol that will list out all the methods and properties an object will need help with. Another object, known as the delegate, will provide the help needed by adopting and implementing the protocol methods. Objects ask for help by sending messages to their delegates.

Defining Delegate Protocols

Let’s say you want to implement Delegation for your object graph that includes the Project object and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required