iOS中的几种传值方式

  1. Delegate方式
  2. Protocol方式
  3. Block方式
  4. KVO方式
  5. KVC方式
  6. Event响应链方式

对象之间传递值到底应该选用何种方法?

Delegate UIKit中,Delegate是一种很重要的传值方式。最具代表性的使用场景要属于UITableViewDelegate & UITableViewDataSource这对兄弟。 这种传值方式的特

  1. 不会引起循环引用
  2. 通过required关键字,可以强制要求实现某个协议。

results matching ""

    No results matching ""