2014-12-20

delegates in obj'c

4.24: adda/oop/delegates/delegates in obj'c:
. in the model-view-controller pattern
the model is acting as a server .
. some servers expect you to
provide as input for their startup
an object that serves as your delegate,
the delegate class provided by the client
conforms to the interface expected by the server
and when the server has to provide
some client-specific processing
it is launching one of the client's delegate's methods .
. this is just like if the server
expected the client to input
a set of pointers to subprograms
but by supplying an object instead,
the included set of subprograms can share some variables
whose state persists between subprogram calls
(instance vars of the obj).

No comments:

Post a Comment