The delegate is something like the dog from the "master". I'm thinking about the name for an important instance variable that has to hold a weak reference to this "master" of the delegate. Is there any official name for this?
Apple在“ 可可基础指南”的“可可设计模式”部分中将其称为主机对象/类 。
Maybe you're thinking of "subordinate"?
Your delegate shouldn't have a reference to the object it is delegate for. Instead the main object should pass itself as a parameter to the delegate methods. That way a single object can be delegate for multiple independent objects.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.