Skip to content

API的基础使用

君赏 edited this page Sep 14, 2016 · 1 revision

API的基础使用

ZHTableViewDataSource

@property (nonatomic, assign) NSUInteger sectionNumber; //section的数量

这个属性获取多个种section只读

/*!
 *  @brief 添加分组
 *
 *  @param group 分组对象
 */
- (void)addTableViewGroup:(ZHTableViewGroup *)group;

添加ZHTableViewGroup对象到ZHTableViewDataSource对象里面 一个ZHTableViewGroup对应UITableView的一个section

group对象必须存在,不然内部因为判断导致崩溃

/*!
 *  @brief 根据索引查询所在的组
 *
 *  @param index 索引位置
 *
 *  @return 所在的组
 */
- (ZHTableViewGroup *)groupWithIndex:(NSUInteger)index;

根据section的索引获取托管的ZHTableViewGroup如果索引超出数据范围 会返回nil

/*!
 *  @brief 清除托管的数据
 */
- (void)clearData;

清除托管的数据,可以用于重新组织cell,比如之前隐藏的cell因为某一种情况展示出来

Clone this wiki locally