ios - UIKit中的UIDataSourceModelAssociation协议到底是干嘛用的?
大家讲道理
大家讲道理 2017-04-17 15:21:07
0
1
728

The UIDataSourceModelAssociation protocol defines an interface for providing persistent references to data objects in your app. Your data source objects can adopt this protocol in order to assist a corresponding table or collection view during the state restoration process. Those classes use the methods of this protocol to ensure that the same data objects (and not just the same row indexes) are scrolled into view and selected.

根据上面引子文档的定义,这个协议用来帮助table view或 collection view保持对数据模型中对象的引用,确保在选中行时,相应的对象也被选中。

我不明白这个协议的作用到底体现在哪里,而且我实现了协议中仅有的两个方法,然后运行程序,点击table view的行,发现它们根本没有被调用过。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

全員に返信(1)
黄舟

我也发现了没被调用,不知道调用的条件是什么.

いいねを押す +0
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!