【UIKit-110-9】#import <UIKit/UITableView.h>数据源

来源:互联网 发布:微信专用淘宝二维码 编辑:程序博客网 时间:2024/06/05 05:02

@protocol UITableViewDataSource<NSObject>


@required


// section 中有多少行

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

// cell

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


@optional



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;             // 多少个cell Default is 1


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

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




- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath; // 可以编辑


- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath; // 可以移动




- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;                                                    // 索引数据


- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;  // 索引对应的section值






- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath;// 增加删除移动之后,调用button,




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


@end










0 0
原创粉丝点击