NSNotificationCenter vs delegation( using protocols )?

前端 未结 6 645
天涯浪人
天涯浪人 2020-11-27 10:56

What are the pros and cons of each of them?
Where should I use them specifically?

6条回答
  •  广开言路
    2020-11-27 11:25

    Their purposes are different:

    • Notification is used to broadcast messages to possibly several recipients unknown from the sender.

    • Delegation is used to send messages to a single known recipient acting on behalf of the sender.

提交回复
热议问题