UITableViewDataSource和UITableViewDelegate函数(一)

1、UITableViewDataSource协议

/**

 *  @see 一共有多少个分区(默认为1)

 *  @param tableView - 当前TableView        

 *  @return NSInteger - 组数       

 */

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;

/**

 *  @see 第Section分区一共多少行

 *  @param tableView - 当前TableView        

 *  @param section - 组数

 *  @return NSInteger - 行数       

 */

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;

/**

 *  @see 创建第Section分区的第Row行的UITableViewCell对象(indexPath包含Section和Row)

 *  @param tableView - 当前TableView        

 *  @param indexPath - cell行数

 *  @return UITableViewCell      

 */

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see 第Section分区头部标题     

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;

 *  @see 第Section分区底部标题    

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;

 *  @see 某一行是否可以编辑(删除)    

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see 某一行是否可以移动来重新排序    

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see UITableView右边索引栏的内容    

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;

 *  @see

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index; 

 *  @see

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath;

 *  @see 某一行的高度

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see 第Section分区头部的高度

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;

 *  @see 第Section分区尾部的高度

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;

 *  @see 选中UITableView的某一行

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see 反选UITableView的某一行

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath;

 *  @see 第Section分区头部显示的视图

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;  

 *  @see 第Section分区尾部显示的视图

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;

 *  @see 设置每一行的等级缩进(数字越小,等级越高)

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath;



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值